Allocate
HarnessRecursiveDBModelsPricingDocs
Sign inTry for free
Try for free
Allocate
HarnessRecursiveDBModelsPricingDocsSign in
Try for freeBook a call
Allocate documentation
QuickstartsYour first inference callUse Allocate from your coding agent
OnboardingGetting accessPush your dataImport mappingData residency
PlatformGatewayRoutesModelsKeysMeter
API referenceCreate a chat completionList models
PlanesPrivate Inference CloudCloudlightCloudheavyLearningAgentsRecursiveDBTraining
Allocate
Try for freeBook a call
Product
Cloud agentsModelsRecursiveDBTrainingMeterPricing
Solutions
HealthcareInsuranceFinancial servicesOperationsAgenciesStartupsSouth Africa
Resources
DocumentationAPI referenceChangelogFree toolsGlossarySecurity
Popular models
Gemini 3.5 FlashDeepSeek V4GPT-5.5Qwen 3.5Best open-weight modelsExplore all
Company
EnterpriseContactBook a demo
© 2026 Allocate. All rights reserved.POPIA ready · security overview
Allocate
api

Create a chat completion

POST /v1/chat/completions

POST https://api.allocate.network/v1/chat/completions

Runs inference against a model or Route. Supports streaming, tool calls, structured output, and image, PDF, and audio inputs. Every response, including errors, carries the x-allocate-request-id header; successful responses additionally report x-allocate-overhead-ms, held to a 30ms p50 budget.

Request

FieldTypeDescription
model (required)stringA catalog model id, or the name of one of your Routes. A Route pins model, fallback chain, and policy server-side.
messages (required)object[]
streambooleanWhen true, responds with an SSE stream of chunks terminated by [DONE]; usage arrives in the final chunk.
toolsobject[]Function tools. Streamed tool-call arguments reassemble to valid JSON.
tool_choiceanyStandard tool choice: none, auto, required, or a named function.
response_formatobjectStructured output. Supports type json_schema with a schema the response must satisfy.
reasoning_effortstringReasoning effort for models that support it.
max_tokensinteger
temperaturenumber
curl https://api.allocate.network/v1/chat/completions \
  -H "Authorization: Bearer $ALLOCATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "google/gemini-3.5-flash",
  "messages": [
    {
      "role": "user",
      "content": "Say hello."
    }
  ]
}'

Responses

StatusMeaning
200The completion. With stream: true, an SSE stream of chat.completion.chunk events terminated by [DONE], usage in the final chunk.
400Malformed body or missing model field.
401Missing, invalid, or disabled API key (type: authentication_error).
402Billing gate: balance exhausted (type: insufficient_quota). In-flight streams are never interrupted; only new requests are gated.
403Model policy: your organization restricts which providers may serve its prompts, and this request resolved to one outside the allowlist (type: permission_error). The policy wins over the route and the model field.
404Unknown model id, or a Route that resolves to an unknown model (type: not_found_error).
429Provider rate limit, passed through with its native status so client backoff behaves correctly (type: rate_limit_error). Provider detail preserved under error.native.
503Policy check unavailable; the gateway fails closed rather than guessing about provider commitments. Retry shortly (type: api_error).

Response headers

HeaderDescription
x-allocate-request-idUnique id for this request, present on every response including errors; quote it in support conversations.
x-allocate-overhead-msServer-reported gateway overhead for this request in milliseconds.
x-allocate-modelThe model that actually served the request. Differs from the requested model only when a Route's declared fallback chain fired; fallbacks are billed at the served model's own price.

Errors

Every error uses this shape so standard SDK retry logic works unchanged. Provider detail is preserved, never substituted.

FieldTypeDescription
message (required)string
type (required)invalid_request_error | authentication_error | insufficient_quota | permission_error | not_found_error | rate_limit_error | api_error
codestring | integer | null
providerstringPresent on provider-originated errors.
nativeanyThe provider's original error body, preserved for debugging.
PreviousMeterNextList models
On this pageRequestResponsesResponse headersErrors