For the complete documentation index, see llms.txt. This page is also available as Markdown.

Responses [BETA]

Create a model response

post

This endpoint creates a response using the specified model.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

A request object for generating model responses and controlling router behavior. This object contains suggested parameters to generate a response from the specified model. Many parameters are optional, and you may include other parameters as required. Not all providers support the same parameters. Unsupported parameters can cause requests to fail or limit the providers able to process them.

preferencestring · enumOptional

The provider preference for handling the request.

Possible values:
allowed_providersstring[] · nullableOptional

The providers that are allowed to be used for the completion.

Example: ["mistral","scaleway"]
eu_nativeboolean · nullableOptional

Whether to consider only providers based and regulated withing the EU. Even when false, all our endpoints are GDPR compliant.

Example: false
allow_quantizationboolean · nullableOptional

Whether to allow quantized endpoints.

Example: true
allow_zero_data_retentionboolean · nullableOptional

Whether to use only ZDR providers.

enable_model_fallbackboolean · nullableOptional

Whether to allow model fallback when a model is currently unavailable.

fallbacksstring[] · nullableOptional

The providers that are allowed to be used for the completion.

Example: ["mistral-small-2506","mistral-small-2503"]
modelstringRequired

The model to use for the response.

Example: gpt-oss-120b
inputone ofRequired

The text, messages, or tool outputs to send to the model.

stringOptionalExample: Tell me a short story.
or
object[]Optional
instructionsstring · nullableOptional

Instructions that guide the model's response.

max_output_tokensinteger · nullableOptional

The maximum number of tokens to generate.

temperaturenumber · nullableOptional

Controls randomness in the output.

top_pnumber · nullableOptional

Controls output diversity using nucleus sampling.

streambooleanOptional

Whether to stream response events.

Default: false
toolsobject[] · nullableOptional

Tools the model may call.

tool_choiceone ofOptional

Controls which tool the model may call.

stringOptional
or
objectOptional
parallel_tool_callsboolean · nullableOptional

Whether the model may call tools in parallel.

previous_response_idstring · nullableOptional

The previous response to continue from.

reasoningobject · nullableOptional

Reasoning configuration for supported models.

textobject · nullableOptional

Text output configuration.

Responses
200

A model response.

idstringRequired

The unique identifier for the response.

Example: resp_1234567890
objectstringRequired

The type of object returned.

Example: response
created_atintegerRequired

The Unix timestamp when the response was created.

Example: 1715155200
statusstringRequired

The current response status.

Example: completed
providerstringOptional

The provider that generated the response.

Example: nebius
modelstringRequired

The model that generated the response.

Example: gpt-oss-120b
outputobject[]Required

The output items generated by the model.

output_textstring · nullableOptional

The combined text generated by the model, when available.

post/responses
POST /v1/responses HTTP/1.1
Host: api.cortecs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 530

{
  "preference": "speed",
  "allowed_providers": [
    "mistral",
    "scaleway"
  ],
  "eu_native": false,
  "allow_quantization": true,
  "allow_zero_data_retention": true,
  "enable_model_fallback": true,
  "fallbacks": [
    "mistral-small-2506",
    "mistral-small-2503"
  ],
  "model": "gpt-oss-120b",
  "input": "Tell me a short story.",
  "instructions": "text",
  "max_output_tokens": 1,
  "temperature": 1,
  "top_p": 1,
  "stream": false,
  "tools": [
    {}
  ],
  "tool_choice": "text",
  "parallel_tool_calls": true,
  "previous_response_id": "text",
  "reasoning": {},
  "text": {},
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
{
  "id": "resp_1234567890",
  "object": "response",
  "created_at": 1715155200,
  "status": "completed",
  "provider": "nebius",
  "model": "gpt-oss-120b",
  "output": [
    {}
  ],
  "output_text": "text",
  "usage": {
    "input_tokens": 1,
    "output_tokens": 1,
    "total_tokens": 1
  }
}

Last updated