OpenAI Chat
Create a chat completion (OpenAI-compatible)
Changed onChat with a language model. This endpoint is consistent with the OpenAI Chat Completions API and may be used with the OpenAI JS or Python SDK by setting the base URL to https://api.telnyx.com/v2/ai/openai.
post/ai/openai/chat/completions
Request
- Base URLhttps://api.telnyx.com/v2
- URLhttps://api.telnyx.com/v2/ai/openai/chat/completions
- AuthHTTP bearer
Request body
Example request
{
"messages": [
{
"role": "system",
"content": "You are a friendly chatbot."
},
{
"role": "user",
"content": "Hello, world!"
}
]
}Response
Successful Response
object required
Changes
- breaking
the
request property type changed fromobjectto no type - warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
/ - info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
the request property
became nullable - info
removed discriminator from
/request property - info
added to the
request propertyoneOflist
- breaking
- info
endpoint added
- info