Documentation menu

Provider keys

Your own provider keys for the environment.

requests to a provider's models run on your key for it, and the provider bills you directly.

OperationMethodSDK
List your provider keysGEThixel.providerKeys.list
Store a provider keyPUThixel.providerKeys.put
Remove a provider keyDELETEhixel.providerKeys.remove
Check a provider keyPOSThixel.providerKeys.check

List your provider keys#

GET/v1/provider_keyshixel.providerKeys.list

Every provider key you connected to the environment, at most one per provider, by 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.

Response 200: EnvironmentProviderKeyList

FieldTypeDescription
data requiredarray of EnvironmentProviderKey
data[].id requiredstringThe id of a provider key a customer brought (pcred_…).
data[].environment_id requiredstringThe id of an environment (env_…).
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[].last_check requiredobjectThe last check of the key with its provider.
data[].last_check.status required"valid" | "rejected" | "failed" | "unchecked"valid: the provider accepted the key. rejected: it refused it (401 or 403). failed: the provider could not be reached or answered otherwise. unchecked: the platform has no check for this provider.
data[].last_check.http_status requiredinteger | nullThe provider's HTTP status; null when no answer came or nothing was asked.
data[].last_check.checked_at requiredstring (date-time)
data[].created_at requiredstring (date-time)
data[].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.
  • 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/provider_keys" \
  -H "Authorization: Bearer $HIXEL_API_KEY"

Store a provider key#

PUT/v1/provider_keys/{provider}hixel.providerKeys.put

Stores your key for provider, replacing the one the environment had, and publishes it to the gateway: requests to that provider's models then run on it. The key is checked with the provider first (last_check); a key the check finds wrong is stored all the same. It is encrypted at rest and never returned by any read. Takes a project key with the admin role and x-hixel-environment.

Takes a project key with the admin role, naming the environment in x-hixel-environment; an environment's own key may not. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
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: EnvironmentProviderKey

FieldTypeDescription
id requiredstringThe id of a provider key a customer brought (pcred_…).
environment_id requiredstringThe id of an environment (env_…).
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.
last_check requiredobjectThe last check of the key with its provider.
last_check.status required"valid" | "rejected" | "failed" | "unchecked"valid: the provider accepted the key. rejected: it refused it (401 or 403). failed: the provider could not be reached or answered otherwise. unchecked: the platform has no check for this provider.
last_check.http_status requiredinteger | nullThe provider's HTTP status; null when no answer came or nothing was asked.
last_check.checked_at requiredstring (date-time)
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: the 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 project key was revoked or expired while the request ran.
    • project_key_required: an environment's key was sent; this endpoint takes a project key.
    • 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, or an archived one.
  • 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/provider_keys/openai" \
  -H "Authorization: Bearer $HIXEL_PROJECT_KEY" \
  -H "x-hixel-environment: env_123" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "sk-…"
  }'

Remove a provider key#

DELETE/v1/provider_keys/{provider}hixel.providerKeys.remove

Deletes your key for provider. Requests to that provider's models are then refused (provider_key_missing) unless the platform's keys are allowed for the environment. Answers 204 with no body.

Takes a project key with the admin role, naming the environment in x-hixel-environment; an environment's own key may not. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

NameInTypeDescription
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: the 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 project key was revoked or expired while the request ran.
    • project_key_required: an environment's key was sent; this endpoint takes a project key.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • 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, or an archived one.
  • 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/provider_keys/openai" \
  -H "Authorization: Bearer $HIXEL_PROJECT_KEY" \
  -H "x-hixel-environment: env_123"

Check a provider key#

POST/v1/provider_keys/{provider}/checkhixel.providerKeys.check

Checks your stored key for provider with the provider again, with the cheapest call it answers (listing models), and records the result in last_check.

Takes a project key with the admin role, naming the environment in x-hixel-environment; an environment's own key may not. Accepts an Idempotency-Key header: a retry with the same key runs once.

Parameters

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

Response 200: EnvironmentProviderKey

FieldTypeDescription
id requiredstringThe id of a provider key a customer brought (pcred_…).
environment_id requiredstringThe id of an environment (env_…).
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.
last_check requiredobjectThe last check of the key with its provider.
last_check.status required"valid" | "rejected" | "failed" | "unchecked"valid: the provider accepted the key. rejected: it refused it (401 or 403). failed: the provider could not be reached or answered otherwise. unchecked: the platform has no check for this provider.
last_check.http_status requiredinteger | nullThe provider's HTTP status; null when no answer came or nothing was asked.
last_check.checked_at requiredstring (date-time)
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: the 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 project key was revoked or expired while the request ran.
    • project_key_required: an environment's key was sent; this endpoint takes a project key.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404
    • 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, or an archived one.
  • 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/provider_keys/openai/check" \
  -H "Authorization: Bearer $HIXEL_PROJECT_KEY" \
  -H "x-hixel-environment: env_123"