Skip to main content
Every request to the Infyrence Gateway is authenticated with an API key. You send the key as an HTTP Bearer token in the Authorization header. The gateway is OpenAI-compatible, so the OpenAI SDKs send this header for you once you set your key.

Get your API key

Create and manage keys in the dashboard. Your key looks like sk- followed by a long string.
1

Open the dashboard

Go to API keys in your Infyrence dashboard.
2

Create a key

Create a new key and give it a name so you can identify it later.
3

Copy the key

Copy the full sk-... value and store it somewhere safe.
The full key value is shown only once, at creation. Infyrence stores only a hash of your key and cannot show it to you again. If you lose it, create a new key and update your app.

Send the key

Set the Authorization header to Bearer followed by your key.
Point an OpenAI SDK at the Infyrence base URL and pass your key as the api_key (Python) or apiKey (JavaScript). No other code change is needed.
Every model and inference endpoint under https://api.infyrence.com/v1 requires this header, including GET /v1/models. The public status endpoint GET /v1/health/providers is the only exception.

Keep your key secret

An API key grants access to your account balance and usage. Treat it like a password.
Use your key only from server-side code. Do not embed it in browsers, mobile apps, or any client that ships to end users, and do not commit it to source control. Load it from an environment variable or a secrets manager instead.
If a key is exposed, revoke it in the dashboard and create a new one. A revoked key stops working, and any request that presents it receives a 401.

Authentication errors

If the Authorization header is missing, malformed, or presents a key that is unknown, revoked, or expired, the gateway responds with 401 and an error body of type authentication_error.
string
A human-readable description of the problem.
string
The category of error. For authentication failures this is authentication_error.
string | null
A stable, machine-readable code when available, for example invalid_api_key.
string
The id of the failed request. It also appears in the X-Request-Id response header. Include it when contacting support.
Common causes of a 401:
The Authorization header is absent or does not start with Bearer . Send Authorization: Bearer sk-....
The key does not match any key on your account. Confirm you copied the full sk-... value with no extra whitespace.
The key was revoked in the dashboard. Create a new key and update your app.
The key passed its expiration date. Create a new key.
A 401 means the request was not authenticated. A different status, 402, means the request was authenticated but your account has no remaining platform balance. See Errors for the full list.

Next steps

List models

Call GET /v1/models for the live list of available models.

Create a chat completion

Send your first authenticated request.