Telnyx · Schema
ChatCompletionRequest
CommunicationsCPaaSVoiceSMSIoTTelecommunicationsMessagingArtificial IntelligenceMCPVoice AIPhone NumbersInference
Properties
| Name | Type | Description |
|---|---|---|
| api_key_ref | string | If you are using an external inference provider like xAI or OpenAI, this field allows you to pass along a reference to your API key. After creating an [integration secret](https://developers.telnyx.co |
| best_of | integer | This is used with `use_beam_search` to determine how many candidate beams to explore. |
| early_stopping | boolean | This is used with `use_beam_search`. If `true`, generation stops as soon as there are `best_of` complete candidates; if `false`, a heuristic is applied and the generation stops when is it very unlikel |
| enable_thinking | boolean | Whether to enable the thinking/reasoning phase for models that support it (e.g., QwQ, Qwen3). When set to false, the model will skip the internal reasoning step and respond directly, which can reduce |
| frequency_penalty | number | Higher values will penalize the model from repeating the same output tokens. |
| guided_choice | array | If specified, the output will be exactly one of the choices. |
| guided_json | object | Must be a valid JSON schema. If specified, the output will follow the JSON schema. |
| guided_regex | string | If specified, the output will follow the regex pattern. |
| length_penalty | number | This is used with `use_beam_search` to prefer shorter or longer completions. |
| logprobs | boolean | Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. |
| max_tokens | integer | Maximum number of completion tokens the model should generate. |
| messages | array | A list of the previous chat messages for context. |
| min_p | number | This is an alternative to `top_p` that [many prefer](https://github.com/huggingface/transformers/issues/27670). Must be in [0, 1]. |
| model | string | The language model to chat with. |
| n | number | This will return multiple choices for you instead of a single chat completion. |
| presence_penalty | number | Higher values will penalize the model from repeating the same output tokens. |
| response_format | object | Use this is you want to guarantee a JSON output without defining a schema. For control over the schema, use `guided_json`. |
| seed | integer | If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. |
| stop | object | Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. |
| stream | boolean | Whether or not to stream data-only server-sent events as they become available. |
| temperature | number | Adjusts the "creativity" of the model. Lower values make the model more deterministic and repetitive, while higher values make the model more random and creative. |
| tool_choice | string | |
| tools | array | The `function` tool type follows the same schema as the [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat). The `retrieval` tool type is unique to Telnyx. You may pass |
| top_logprobs | integer | This is used with `logprobs`. An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. |
| top_p | number | An alternative or complement to `temperature`. This adjusts how many of the top possibilities to consider. |
| use_beam_search | boolean | Setting this to `true` will allow the model to [explore more completion options](https://huggingface.co/blog/how-to-generate#beam-search). This is not supported by OpenAI. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/api-evangelist/telnyx/main/json-schema/telnyx-chat-completion-request-schema.json",
"title": "ChatCompletionRequest",
"x-generated": "2026-10-08",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/telnyx-chat-api-openapi.yml#/components/schemas/ChatCompletionRequest",
"properties": {
"api_key_ref": {
"description": "If you are using an external inference provider like xAI or OpenAI, this field allows you to pass along a reference to your API key. After creating an [integration secret](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret) for you API key, pass the secret's `identifier` in this field.",
"type": "string"
},
"best_of": {
"description": "This is used with `use_beam_search` to determine how many candidate beams to explore.",
"type": "integer"
},
"early_stopping": {
"default": false,
"description": "This is used with `use_beam_search`. If `true`, generation stops as soon as there are `best_of` complete candidates; if `false`, a heuristic is applied and the generation stops when is it very unlikely to find better candidates.",
"type": "boolean"
},
"enable_thinking": {
"default": true,
"description": "Whether to enable the thinking/reasoning phase for models that support it (e.g., QwQ, Qwen3). When set to false, the model will skip the internal reasoning step and respond directly, which can reduce latency. Defaults to true.",
"type": "boolean"
},
"frequency_penalty": {
"default": 0,
"description": "Higher values will penalize the model from repeating the same output tokens.",
"type": "number"
},
"guided_choice": {
"description": "If specified, the output will be exactly one of the choices.",
"items": {
"type": "string"
},
"type": "array"
},
"guided_json": {
"additionalProperties": true,
"description": "Must be a valid JSON schema. If specified, the output will follow the JSON schema.",
"type": "object"
},
"guided_regex": {
"description": "If specified, the output will follow the regex pattern.",
"type": "string"
},
"length_penalty": {
"default": 1,
"description": "This is used with `use_beam_search` to prefer shorter or longer completions.",
"type": "number"
},
"logprobs": {
"default": false,
"description": "Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.",
"type": "boolean"
},
"max_tokens": {
"description": "Maximum number of completion tokens the model should generate.",
"type": "integer"
},
"messages": {
"description": "A list of the previous chat messages for context.",
"items": {
"$ref": "#/$defs/ChatCompletionSystemMessageParam"
},
"type": "array"
},
"min_p": {
"description": "This is an alternative to `top_p` that [many prefer](https://github.com/huggingface/transformers/issues/27670). Must be in [0, 1].",
"type": "number"
},
"model": {
"default": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"description": "The language model to chat with.",
"type": "string"
},
"n": {
"description": "This will return multiple choices for you instead of a single chat completion.",
"type": "number"
},
"presence_penalty": {
"default": 0,
"description": "Higher values will penalize the model from repeating the same output tokens.",
"type": "number"
},
"response_format": {
"$ref": "#/$defs/ChatCompletionResponseFormatParam",
"description": "Use this is you want to guarantee a JSON output without defining a schema. For control over the schema, use `guided_json`."
},
"seed": {
"description": "If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.",
"type": "integer"
},
"stop": {
"description": "Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.",
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 4,
"type": "array"
}
]
},
"stream": {
"default": false,
"description": "Whether or not to stream data-only server-sent events as they become available.",
"type": "boolean"
},
"temperature": {
"default": 0.1,
"description": "Adjusts the \"creativity\" of the model. Lower values make the model more deterministic and repetitive, while higher values make the model more random and creative.",
"type": "number"
},
"tool_choice": {
"enum": [
"none",
"auto",
"required"
],
"type": "string"
},
"tools": {
"description": "The `function` tool type follows the same schema as the [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat). The `retrieval` tool type is unique to Telnyx. You may pass a list of [embedded storage buckets](https://developers.telnyx.com/api-reference/embeddings/embed-documents) for retrieval-augmented generation.",
"items": {
"oneOf": [
{
"$ref": "#/$defs/ChatCompletionToolParam"
},
{
"$ref": "#/$defs/Retrieval"
}
]
},
"type": "array"
},
"top_logprobs": {
"description": "This is used with `logprobs`. An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.",
"type": "integer"
},
"top_p": {
"description": "An alternative or complement to `temperature`. This adjusts how many of the top possibilities to consider.",
"type": "number"
},
"use_beam_search": {
"default": false,
"description": "Setting this to `true` will allow the model to [explore more completion options](https://huggingface.co/blog/how-to-generate#beam-search). This is not supported by OpenAI.",
"type": "boolean"
}
},
"required": [
"messages"
],
"type": "object",
"$defs": {
"BucketIds": {
"properties": {
"bucket_ids": {
"description": "List of [embedded storage buckets](https://developers.telnyx.com/api-reference/embeddings/embed-documents) to use for retrieval-augmented generation.",
"items": {
"type": "string"
},
"type": "array"
},
"max_num_results": {
"description": "The maximum number of results to retrieve as context for the language model.",
"type": "integer"
}
},
"required": [
"bucket_ids"
],
"title": "BucketIds",
"type": "object"
},
"ChatCompletionResponseFormatParam": {
"properties": {
"type": {
"enum": [
"text",
"json_object"
],
"type": "string"
}
},
"required": [
"type"
],
"title": "ChatCompletionResponseFormatParam",
"type": "object"
},
"ChatCompletionSystemMessageParam": {
"properties": {
"content": {
"oneOf": [
{
"title": "Content String",
"type": "string"
},
{
"items": {
"additionalProperties": false,
"properties": {
"image_url": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"enum": [
"text",
"image_url"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"title": "Text and Image Array",
"type": "array"
}
]
},
"role": {
"enum": [
"system",
"user",
"assistant",
"tool"
],
"type": "string"
}
},
"required": [
"content",
"role"
],
"title": "ChatCompletionSystemMessageParam",
"type": "object"
},
"ChatCompletionToolParam": {
"properties": {
"function": {
"$ref": "#/$defs/FunctionDefinition"
},
"type": {
"enum": [
"function"
],
"type": "string"
}
},
"required": [
"function",
"type"
],
"title": "Function",
"type": "object"
},
"FunctionDefinition": {
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"parameters": {
"additionalProperties": true,
"type": "object"
}
},
"required": [
"name"
],
"title": "FunctionDefinition",
"type": "object"
},
"Retrieval": {
"properties": {
"retrieval": {
"$ref": "#/$defs/BucketIds"
},
"type": {
"enum": [
"retrieval"
],
"type": "string"
}
},
"required": [
"type",
"retrieval"
],
"title": "Retrieval",
"type": "object"
}
}
}
Work with this as data
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for schemas
4 MCP tools reach this
find_json_schemasBrowse and filter every JSON Schema in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/telnyx-chat-completion-request"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.