Skip to main content
POST /llm/invoke makes one non-streaming LLM invocation. Supply the instructions and context in messages, and choose the response format. The result arrives in the HTTP response; there is no task to poll. Authenticate with your existing sk_live_* API key. Set OVERTEN_API_KEY to that key before running these examples. Both X-API-Key and Authorization: Bearer are supported. The examples print the response body directly. Text examples add a trailing newline; JSON examples use jq . to format the response. If jq is not installed, remove | jq . to print the JSON as returned.

Return text

Omit response_format, or set it to {"type": "text"}.
The body is plain text (Content-Type: text/plain), for example:

Return JSON

Use response_format: {"type": "json"} for a JSON value without a fixed schema. Describe the desired structure in your messages.
Response

Return JSON matching a schema

Use json_schema when your consumer needs a particular structure. The backend validates the result against your schema before charging API credits and returning it. Objects, arrays, and scalar JSON values are supported.
Response
There is no added text, result, or billing envelope. JSON modes return Content-Type: application/json. Schemas use JSON Schema 2020-12; inline schemas and local $ref pointers are supported. External references, schema IDs, anchors, and dynamic/recursive reference keywords are not supported.

Request fields

For conversation context, send the relevant previous messages with each invocation. Each HTTP request is a new invocation and may incur a charge.

Authentication and billing

This endpoint inherits the existing API key permissions and rate limits. Workspace keys require permission to create content. The organization associated with the API key pays, including for personal-scope API keys. The existing API balance check runs before the model call. Its minimum for LLM invocation is 6 credits; this is an admission floor, not a fixed price. A successful call costs ceil(billable_model_cost_usd / 0.0014) credits, including applicable backend billing offers. Failed invocations, invalid output, and rejected requests do not deduct organization API credits. Optional user_id and session_id support attribution. They are not needed to identify the organization, and do not trigger a separate personal credit charge. Response headers keep accounting information separate from your result: To inspect these headers, add -i to the curl command and remove | jq . if present. This prints the headers followed by the response body. The request ID is an audit identifier, not a document run or a pollable task. As with document generation, a settlement failure is logged for reconciliation and does not discard an otherwise successful result.

Errors

Runtime errors use FastAPI’s detail envelope, for example:
Request validation errors use the standard FastAPI detail list. For predefined writing operations, see Text editing.