On this page

Inference API

The inference API is compatible with the OpenAI API. Send each request with the header Authorization: Bearer <key>. The key must have the scope inference.

Endpoints#

Method and pathUse
POST /v1/chat/completionsChat with a language model. See Chat completions.
POST /v1/completionsComplete a text prompt.
POST /v1/embeddingsMake vectors from text. See Embeddings.
POST /v1/messagesThe Anthropic Messages format, for shared models.
GET /v1/modelsList the shared models and your deployments.
POST /v1/predict/<deployment ID>Send a request to a custom deployment.

Each parameter is in the API reference.

Use a deployment#

To send a request to your own deployment, use the deployment ID as the model.

shell
curl "$EMBER_API_URL/v1/chat/completions" \
  -H "Authorization: Bearer $EMBER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "dep_abc123", "messages": [{"role": "user", "content": "Hello"}]}'

If the deployment has zero replicas, the first request starts a replica. This request waits during the cold start.

Errors#

StatusMeaning
401The key is missing, not valid or revoked.
402The organization is at its spend limit for this month.
403The key does not have the necessary scope, or the organization is suspended.
404The model or deployment does not exist.
429The organization is above its rate limit. Wait for the time in Retry-After.
503No replica is available. Send the request again later.
504The model did not answer in time.

Each error code and what to do is in Rate limits and errors.