Documentation
Chat completions
Request fields, tools, structured output and the response object.
Base URL for this deployment: https://www.aiteraiworld.com/api/v1
POST /chat/completions
The request body follows the OpenAI chat format. Fields outside the list below are passed through to providers that understand them.
| Field | Type | Notes |
|---|---|---|
model | string | Catalog id such as author/model, or an alias such as author/model:free. |
messages | array | Roles system, user, assistant and tool. Content may be a string or an array of parts (text and images where the model supports them). Tool results need tool_call_id. |
stream | boolean | Server-sent events; see Streaming. |
max_tokens | integer | Output cap. Defaults to 256, so set it explicitly for long answers. max_completion_tokens is accepted as a synonym. |
temperature, top_p, stop, seed | various | Sampling controls. Support varies per endpoint; see the model page. |
tools | array | Function definitions in the OpenAI shape. Models without tool support are skipped when provider.require_parameters is set. |
response_format | object | json_object or json_schema. Endpoints that cannot honour it are skipped. |
transforms | array | ["middle-out"] trims the middle of an over-long conversation to fit the context window instead of failing. |
provider | object | Routing preferences; see Provider routing. |
user, metadata | string, object | Stored on the generation record for your own reporting. |
Tool calling
{
"model": "author/model",
"messages": [{ "role": "user", "content": "What is the weather in Bristol?" }],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] }
}
}]
}A tool call is returned as message.tool_calls with finish_reason set to tool_calls. Append the assistant message and a tool message carrying the result, then call again. Filter the catalog by Tool calling to find models that support it.
Structured output
Set response_format to {"type": "json_object"} or supply a JSON schema. Providers that cannot enforce the format are excluded from routing for that request, so a 503 means no eligible endpoint remained.
Generation records
Every request creates a generation record with token counts, provider, latency, status and final cost. Fetch it with the id from the response header; the gen- prefix is optional.
curl https://www.aiteraiworld.com/api/v1/generation?id=6f1c… -H "Authorization: Bearer $AITER_API_KEY"GET /activity lists your recent records with daily, weekly and monthly totals. The same data is on the Usage page and in the CSV export.