Skip to content
API reference

Inference API overview

Base URL, authentication, common fields, and error format of the Engy Inference API.

This page describes the conventions that apply to every endpoint of the Engy Inference API. It is intended for developers who call the API directly or through an SDK.

Base URL

https://api.engy.ai

Text endpoints use the /v1 path prefix. Video task endpoints use the /v2 path prefix.

Authentication

Send your API key in the Authorization header:

Authorization: Bearer sk-engy-...

The POST /v1/messages endpoint also accepts the key in the x-api-key header. The GET /v1/models and POST /v1/messages/count_tokens endpoints do not require a key.

To create an API key, see API keys.

Compatibility

EndpointCompatible with
POST /v1/chat/completionsOpenAI Chat Completions
POST /v1/completionsOpenAI Completions
POST /v1/messagesAnthropic Messages
POST /v1/messages/count_tokensAnthropic token counting
POST /v1/responsesOpenAI Responses, without stored state
GET /v1/modelsOpenAI Models
/v2/video_generation endpointsMiniMax video generation, version 2

The provider object

The provider object sets requirements for the worker that serves a request. It is accepted on /v1/chat/completions, /v1/completions, /v1/messages, and /v1/responses.

FieldTypeDefaultDescription
zdrBooleanfalseIf true, only ZDR-certified workers serve the request.
region_onlyArray of stringsNoneOnly workers in these regions serve the request. Values: eu, us, cn, apac, other.
region_excludeArray of stringsNoneWorkers in these regions do not serve the request. Values: eu, us, cn, apac, other.
require_proofBooleanfalseIf true, only workers that can produce proofs serve the request, and the response includes a proof field.

A worker must meet all requirements to serve the request. If no available worker meets them, the request fails with status 503. An invalid region value fails with status 400.

Engy removes the provider object before the request reaches the model. For details, see Data retention, Region routing, and Verify responses.

Response headers

HeaderDescription
X-Engy-Request-IdThe unique identifier of the request. Returned on every inference response, including errors.
X-Engy-Charged-MicroThe amount charged, in micro-USD. Returned on non-streaming responses from /v1/chat/completions, /v1/completions, and /v1/messages.
Retry-AfterThe number of seconds to wait before you retry. Returned on non-streaming 429 responses from /v1/chat/completions, /v1/completions, and /v1/responses.

Errors

The OpenAI-compatible endpoints return errors in the following format:

{
  "error": {
    "message": "model 'example' not found",
    "type": "not_found_error",
    "param": null,
    "code": 404
  }
}

The /v1/messages endpoint returns errors in the Anthropic format:

{
  "type": "error",
  "error": {"type": "not_found_error", "message": "model 'example' not found"}
}

For the status codes, error types, and retry guidance, see Errors and limits.