X-AIO_FrameX-AIO
Chat

Create Chat Completions

POST
/v1/chat/completions

Generates one or more responses from a language model using the conversation context provided by the user. This core endpoint supports question answering, conversation, content creation, and both streaming and non-streaming responses.

AuthorizationBearer <token>

In: header

Header Parameters

Content-Type*string
Accept*string
Authorization?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

text/event-stream

curl -X POST "https://example.com/v1/chat/completions" \  -H "Content-Type: application/json" \  -H "Accept: application/json" \  -H "Authorization: Bearer {{YOUR_API_KEY}}" \  -H "Content-Type: application/json" \  -d '{    "model": "Qwen3-30B-A3B-Instruct-2507",    "messages": [      {        "role": "system",        "content": "You are a helpful assistant."      },      {        "role": "user",        "content": "Hello!"      }    ],    "top_k": 0,    "min_p": 0,    "stream": true  }'
{  "id": "chatcmpl-123",  "object": "chat.completion",  "created": 1677652288,  "choices": [    {      "index": 0,      "message": {        "role": "assistant",        "content": "\n\nHello there, how may I assist you today?"      },      "finish_reason": "stop"    }  ],  "usage": {    "prompt_tokens": 9,    "completion_tokens": 12,    "total_tokens": 21  }}