Skip to content

Chat with Responses ​

Chats and Reponses are the two most used entry points in the text series. POST /v1/chat/completions is usually used when an OpenAI-compatible client is already in the text series; POST /v1/responses is used when a Reponses format, multi-modular input or tool call style is needed. Claude compatible client POST /v1/messages.

Chat Completions ​

http
POST /v1/chat/completions
bash
curl https://moonnexai.com/v1/chat/completions \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-terra",
    "messages": [
      {
        "role": "system",
        "content": "你是一个简洁的开发者助手。"
      },
      {
        "role": "user",
        "content": "写一句 API 接入成功后的欢迎语。"
      }
    ]
  }'

Responses ​

http
POST /v1/responses
POST /v1/responses/compact
bash
curl https://moonnexai.com/v1/responses \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-terra",
    "input": "请把这句话改写得更适合开发者文档:接入以后就可以用了。"
  }'

Long conversations need to be reduced by using POST /v1/responses/compact and choosing a model that supports the context compression.

Messages ​

http
POST /v1/messages
bash
curl https://moonnexai.com/v1/messages \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "moonnexai-claude",
    "max_tokens": 512,
    "messages": [
      {
        "role": "user",
        "content": "总结这个 API 的用途。"
      }
    ]
  }'

Common field ​

fieldApplication APIAnnotations
modelAllModel name.
messagesChat Completions, MessagesMulti-cycle conversation messages.
inputResponsestext or structured input.
max_tokensMessages, etc.Limit the length of generation.
streamAPI supporting streamingUse SSE when setting true to return.

Select Recommendations ​

RequirementsRecommendations
Compatible common chat clientUse /v1/chat/completions.
Use Responses formatUse /v1/responses.
Use Claude to compatibility request bodyUse /v1/messages.
Streaming output neededConfirm SSE support in the client and set stream: true.

Relevant Pages ​