Documentation menu

Customers

Your customers in the calling key's environment, each named by your own id for it (external_id), and the provider keys they bring.

Every other resource names its customer by that id, as customer.

OperationMethodSDK
Get a customerGEThixel.customers.get
Create or update a customerPUThixel.customers.upsert
List customersGEThixel.customers.list
Create a customerPOSThixel.customers.create
Block a customerPOSThixel.customers.block
Unblock a customerPOSThixel.customers.unblock
Store a customer's provider keyPUThixel.customers.putProviderKey
Remove a customer's provider keyDELETEhixel.customers.removeProviderKey
List a customer's provider keysGEThixel.customers.listProviderKeys
Count customersGEThixel.customerCounts.get

Get a customer#

GET/v1/customers/{external_id}hixel.customers.get

The customer your id names; customer_not_found when the environment has none.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.

Response 200: Customer

FieldTypeDescription
id requiredstringThe platform's id of the customer (cus_…); every path takes your external_id.
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
external_id requiredstringYour id for the customer, unique within the environment: what x-hixel-customer names and what every path takes.
name requiredstring | nullA display name; null for none.
status required"active" | "blocked"active, or blocked: every request naming the customer is refused.
allowed_models requiredarray of string | nullModel names and prefix/* patterns a request may use; null allows every model the level above allows.
metadata requiredobjectYour own JSON, kept as given.
limits requiredSubjectLimits | nullRate and spend limits replacing the environment's customer limits; null when the environment's apply.
limits.rate requiredobject
limits.rate.requests_per_minute requiredinteger | null
limits.rate.tokens_per_minute requiredinteger | null
limits.rate.max_concurrent requiredinteger | null
limits.spend requiredarray of object
limits.spend[].id requiredSpendLimitId
limits.spend[].window required"day" | "week" | "month" | "total"
limits.spend[].limit_micros requiredUnsignedMicros
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/customers/org_42" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Create or update a customer#

PUT/v1/customers/{external_id}hixel.customers.upsert

Creates the customer external_id with the fields given (201), or changes the fields given of the existing one (200). A request naming an unknown customer at the gateway creates it too, so calling this first is optional. external_id is 1 to 256 characters of visible ASCII, not . or ...

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.

Request body: UpsertCustomerBody

FieldTypeDescription
namestring | nullA display name; null removes it.
allowed_modelsarray of string | nullModel names and prefix/* patterns the customer may use, within what the environment allows; null allows every model the environment allows.
metadataobjectYour own JSON, kept as given; replaces the customer's metadata.
limitsobject | nullRate and spend limits ({"rate": {…}, "spend": […]}, as limits reads) replacing the environment's customer limits; null returns the customer to them. A field out of bounds is invalid_request naming its path in param.

Response 200, 201: Customer

200: The customer existed and was changed. 201: The customer was created.

FieldTypeDescription
id requiredstringThe platform's id of the customer (cus_…); every path takes your external_id.
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
external_id requiredstringYour id for the customer, unique within the environment: what x-hixel-customer names and what every path takes.
name requiredstring | nullA display name; null for none.
status required"active" | "blocked"active, or blocked: every request naming the customer is refused.
allowed_models requiredarray of string | nullModel names and prefix/* patterns a request may use; null allows every model the level above allows.
metadata requiredobjectYour own JSON, kept as given.
limits requiredSubjectLimits | nullRate and spend limits replacing the environment's customer limits; null when the environment's apply.
limits.rate requiredobject
limits.rate.requests_per_minute requiredinteger | null
limits.rate.tokens_per_minute requiredinteger | null
limits.rate.max_concurrent requiredinteger | null
limits.spend requiredarray of object
limits.spend[].id requiredSpendLimitId
limits.spend[].window required"day" | "week" | "month" | "total"
limits.spend[].limit_micros requiredUnsignedMicros
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_parameter: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params, invalid_payload, malformed_body, body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X PUT "https://api.hixel.dev/v1/customers/org_42" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Inc."
  }'

List customers#

GET/v1/customershixel.customers.list

A page of the environment's customers, oldest first. The filters combine; pass the same ones with each page's cursor.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Parameters

NameInTypeDescription
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.
external_id_prefixquerystringOnly customers whose external_id starts with this, byte for byte.
namequerystringOnly customers whose name contains this, ignoring case.
statusquery"active" | "blocked"Only customers with this status.
has_own_limitsquerybooleantrue: only customers with limits of their own, which replace the environment's; false: only those the environment's limits apply to.
has_own_allowed_modelsquerybooleantrue: only customers with allowed models of their own; false: only those allowed every model the environment allows.

Response 200: CustomerList

FieldTypeDescription
data requiredarray of Customer
data[].id requiredstringThe platform's id of the customer (cus_…); every path takes your external_id.
data[].organization_id requiredstringThe id of your organization (org_…).
data[].project_id requiredstringThe id of a project (proj_…).
data[].environment_id requiredstringThe id of an environment (env_…).
data[].external_id requiredstringYour id for the customer, unique within the environment: what x-hixel-customer names and what every path takes.
data[].name requiredstring | nullA display name; null for none.
data[].status required"active" | "blocked"active, or blocked: every request naming the customer is refused.
data[].allowed_models requiredarray of string | nullModel names and prefix/* patterns a request may use; null allows every model the level above allows.
data[].metadata requiredobjectYour own JSON, kept as given.
data[].limits requiredSubjectLimits | nullRate and spend limits replacing the environment's customer limits; null when the environment's apply.
data[].limits.rate requiredobject
data[].limits.spend requiredarray of object
data[].created_at requiredstring (date-time)
data[].updated_at requiredstring (date-time)
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_parameter: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/customers" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Create a customer#

POST/v1/customershixel.customers.create

Creates the customer external_id with the fields given, and only creates: an environment that already has a customer by this id answers customer_exists and changes nothing. PUT /v1/customers/{external_id} creates or changes.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Request body: CreateCustomerBody

FieldTypeDescription
external_id requiredstringYour id for the customer: 1 to 256 characters of visible ASCII, not . or .., compared byte for byte.
namestring | nullA display name; null removes it.
allowed_modelsarray of string | nullModel names and prefix/* patterns the customer may use, within what the environment allows; null allows every model the environment allows.
metadataobjectYour own JSON, kept as given; replaces the customer's metadata.
limitsobject | nullRate and spend limits ({"rate": {…}, "spend": […]}, as limits reads) replacing the environment's customer limits; null returns the customer to them. A field out of bounds is invalid_request naming its path in param.

Response 201: Customer

FieldTypeDescription
id requiredstringThe platform's id of the customer (cus_…); every path takes your external_id.
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
external_id requiredstringYour id for the customer, unique within the environment: what x-hixel-customer names and what every path takes.
name requiredstring | nullA display name; null for none.
status required"active" | "blocked"active, or blocked: every request naming the customer is refused.
allowed_models requiredarray of string | nullModel names and prefix/* patterns a request may use; null allows every model the level above allows.
metadata requiredobjectYour own JSON, kept as given.
limits requiredSubjectLimits | nullRate and spend limits replacing the environment's customer limits; null when the environment's apply.
limits.rate requiredobject
limits.rate.requests_per_minute requiredinteger | null
limits.rate.tokens_per_minute requiredinteger | null
limits.rate.max_concurrent requiredinteger | null
limits.spend requiredarray of object
limits.spend[].id requiredSpendLimitId
limits.spend[].window required"day" | "week" | "month" | "total"
limits.spend[].limit_micros requiredUnsignedMicros
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_parameter: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_payload, malformed_body, body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • customer_exists: This environment already has a customer with this id.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/customers" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "org_42"
  }'

Block a customer#

POST/v1/customers/{external_id}/blockhixel.customers.block

Every request naming the customer is refused until it is unblocked.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.

Response 200: Customer

FieldTypeDescription
id requiredstringThe platform's id of the customer (cus_…); every path takes your external_id.
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
external_id requiredstringYour id for the customer, unique within the environment: what x-hixel-customer names and what every path takes.
name requiredstring | nullA display name; null for none.
status required"active" | "blocked"active, or blocked: every request naming the customer is refused.
allowed_models requiredarray of string | nullModel names and prefix/* patterns a request may use; null allows every model the level above allows.
metadata requiredobjectYour own JSON, kept as given.
limits requiredSubjectLimits | nullRate and spend limits replacing the environment's customer limits; null when the environment's apply.
limits.rate requiredobject
limits.rate.requests_per_minute requiredinteger | null
limits.rate.tokens_per_minute requiredinteger | null
limits.rate.max_concurrent requiredinteger | null
limits.spend requiredarray of object
limits.spend[].id requiredSpendLimitId
limits.spend[].window required"day" | "week" | "month" | "total"
limits.spend[].limit_micros requiredUnsignedMicros
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/customers/org_42/block" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Unblock a customer#

POST/v1/customers/{external_id}/unblockhixel.customers.unblock

The customer's requests are let through again.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.

Response 200: Customer

FieldTypeDescription
id requiredstringThe platform's id of the customer (cus_…); every path takes your external_id.
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
external_id requiredstringYour id for the customer, unique within the environment: what x-hixel-customer names and what every path takes.
name requiredstring | nullA display name; null for none.
status required"active" | "blocked"active, or blocked: every request naming the customer is refused.
allowed_models requiredarray of string | nullModel names and prefix/* patterns a request may use; null allows every model the level above allows.
metadata requiredobjectYour own JSON, kept as given.
limits requiredSubjectLimits | nullRate and spend limits replacing the environment's customer limits; null when the environment's apply.
limits.rate requiredobject
limits.rate.requests_per_minute requiredinteger | null
limits.rate.tokens_per_minute requiredinteger | null
limits.rate.max_concurrent requiredinteger | null
limits.spend requiredarray of object
limits.spend[].id requiredSpendLimitId
limits.spend[].window required"day" | "week" | "month" | "total"
limits.spend[].limit_micros requiredUnsignedMicros
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/customers/org_42/unblock" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Store a customer's provider key#

PUT/v1/customers/{external_id}/provider_keys/{provider}hixel.customers.putProviderKey

Stores your customer's own key for provider (bring your own key), replacing the one it had. Requests the customer makes to that provider then run on its key, and are not paid from its wallet. The key is encrypted at rest and never returned by any read. Only when the environment lets customers bring keys for this provider.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.
provider requiredpath"openai" | "anthropic" | "azure" | "google" | "groq" | "mistral" | …The provider the key is for.

Request body: PutProviderKeyBody

FieldTypeDescription
api_key requiredstringThe provider key; never echoed, logged or returned by any read. For bedrock, AWS access keys as JSON text ({"access_key_id","secret_access_key","session_token"?}) or a Bedrock API key; for vertex, the service account's JSON key file as Google issues it.
base_urlstringWhere to send the key instead of the provider's default endpoint: https:// on a public host name. Required for azure and custom.

Response 200: ProviderKey

FieldTypeDescription
id requiredstringThe id of a provider key a customer brought (pcred_…).
provider required"openai" | "anthropic" | "azure" | "google" | "groq" | "mistral" | …An upstream model vendor: what a route names and what a customer can bring its own key for. bedrock is Amazon Bedrock and vertex Google Vertex AI, which serve other vendors' models under their own authentication.
form required"api_key" | "aws_access_keys" | "service_account"What the key holds: a static key (api_key, also a Bedrock API key), Bedrock access keys (aws_access_keys), or a Vertex service account's key file (service_account).
last_four requiredstringThe last four characters of the key, of an AWS access key id (never of its secret), or of a service account's key id (empty when the key file has none).
label requiredstring | nullA service account's email, to tell keys apart; null for every other form.
base_url requiredstring | nullWhere the key is sent instead of the provider's default endpoint; null for the default.
created_at requiredstring (date-time)
updated_at requiredstring (date-time)
customer requiredstringYour id for the customer (its external_id), as every path takes it.

Errors

  • 400
    • invalid_parameter: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params, invalid_payload, malformed_body, body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • byok_disabled: This environment does not let customers bring their own provider keys.
    • byok_provider_not_allowed: This environment does not let customers bring keys for this provider.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X PUT "https://api.hixel.dev/v1/customers/org_42/provider_keys/openai" \
  -H "Authorization: Bearer $HIXEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "sk-…"
  }'

Remove a customer's provider key#

DELETE/v1/customers/{external_id}/provider_keys/{provider}hixel.customers.removeProviderKey

Deletes the customer's key for provider; its requests to that provider are paid as any other again. Answers 204 with no body.

Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.
provider requiredpath"openai" | "anthropic" | "azure" | "google" | "groq" | "mistral" | …The provider the key is for.

Response 204

No body.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • customer_not_found, provider_key_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 409
    • project_archived: This project is archived.
    • environment_archived: This environment is archived.
    • idempotency_key_reused, idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503
    • database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
    • database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X DELETE "https://api.hixel.dev/v1/customers/org_42/provider_keys/openai" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

List a customer's provider keys#

GET/v1/customers/{external_id}/provider_keyshixel.customers.listProviderKeys

A page of the provider keys the customer brought, oldest first, at most one per provider: never the keys.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Parameters

NameInTypeDescription
external_id requiredpathstringYour id for the customer.
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: ProviderKeyList

FieldTypeDescription
data requiredarray of ProviderKey
data[].id requiredstringThe id of a provider key a customer brought (pcred_…).
data[].provider required"openai" | "anthropic" | "azure" | "google" | "groq" | "mistral" | …An upstream model vendor: what a route names and what a customer can bring its own key for. bedrock is Amazon Bedrock and vertex Google Vertex AI, which serve other vendors' models under their own authentication.
data[].form required"api_key" | "aws_access_keys" | "service_account"What the key holds: a static key (api_key, also a Bedrock API key), Bedrock access keys (aws_access_keys), or a Vertex service account's key file (service_account).
data[].last_four requiredstringThe last four characters of the key, of an AWS access key id (never of its secret), or of a service account's key id (empty when the key file has none).
data[].label requiredstring | nullA service account's email, to tell keys apart; null for every other form.
data[].base_url requiredstring | nullWhere the key is sent instead of the provider's default endpoint; null for the default.
data[].created_at requiredstring (date-time)
data[].updated_at requiredstring (date-time)
data[].customer requiredstringYour id for the customer (its external_id), as every path takes it.
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • environment_required: a project key was sent without x-hixel-environment.
    • invalid_params, invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404
    • customer_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.
    • environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/customers/org_42/provider_keys" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Count customers#

GET/v1/customer_countshixel.customerCounts.get

How many customers the environment has: in all, blocked, with limits of their own and with allowed models of their own; each the number the list would give with that one filter.

Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.

Response 200: CustomerCounts

FieldTypeDescription
total requiredinteger
blocked requiredinteger
with_own_limits requiredinteger
with_own_allowed_models requiredinteger

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • environment_required: a project key was sent without x-hixel-environment.
  • 401 api_key_required, invalid_api_key, expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired.
  • 403
    • key_inactive: the key was revoked or expired while the request ran, or an environment's key lost the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404 environment_not_found: x-hixel-environment names an environment outside the project key's project, an archived one, or another than the environment key's own.
  • 500 internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned.
  • 503 database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/customer_counts" \
  -H "Authorization: Bearer $HIXEL_API_KEY"