Create completions
POST

ChatEntity
Examples
File and image processingThe Tedi Completions API does not support file processing via API, such as uploading files or images for analysis. This functionality is currently available only through Dashboard → Chat.At the moment, we do not plan to add this feature to the API, but we’ll continue to monitor demand and may consider it in the future.
Completions Types
There are two main types of completions you can use with the Tedi Completions API:| Type | Description |
|---|---|
| Text Generation | Generate human-like text based on prompts |
| Structured Output | Get responses in predefined JSON formats using JSON-Schema7↗ , Zod-v3↗ and Zod-v4↗ validation |
Request
When making a request to the completions endpoint, you can include the following fields in the request body:An array of message objects that define the conversation history.See ChatEntity for detailed configuration options.
Optional JSON Schema (Draft 7) that defines the expected structure of the response.See ChatEntity for detailed configuration options.
An optional object to configure caching behavior for the request.
By default, caching is enabled with a TTL of 120 seconds. You can
customize these settings by providing the cache object.
Response
Tedi completion output. The format of this field depends on whether you
provided a JSON Schema in the request:
- If a
JSON Schemawas provided, the output will be a structured object conforming to that schema. - If no schema was provided, the output will be a plain text string.
A boolean indicating whether the response was served from cache.
If the response was served from cache, this field indicates the number of
seconds until the cache entry expires. If the response was not cached, this
field will be
null.An object containing detailed information about the steps taken during the
completion process, including any API calls made, their inputs and outputs,
and any errors encountered.
An object containing token usage statistics for the request.