Skip to main content
POST
/
v1
/
chat
/
completions
Chat Completion
curl --request POST \
  --url https://www.anyfast.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "doubao-seed-1-6-vision-250815",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "max_tokens": 8192,
  "temperature": 1,
  "top_p": 0.5,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "stream": false,
  "stop": "<string>"
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 123,
  "model": "doubao-seed-1-6-vision-250815",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Model ID

Available options:
doubao-seed-1-6-vision-250815
Example:

"doubao-seed-1-6-vision-250815"

messages
object[]
required

A list of messages comprising the conversation so far.

Minimum array length: 1
Example:
[{ "role": "user", "content": "Hello!" }]
max_tokens
integer
default:8192

The maximum number of tokens to generate.

Required range: 1 <= x <= 8192
temperature
number
default:1

Sampling temperature. Higher values make output more random.

Required range: 0 <= x <= 2
Example:

1

top_p
number

Nucleus sampling threshold.

Required range: 0 <= x <= 1
frequency_penalty
number
default:0

Penalizes repeated tokens based on their frequency in the text so far.

Required range: -2 <= x <= 2
presence_penalty
number
default:0

Penalizes tokens that have already appeared in the text.

Required range: -2 <= x <= 2
stream
boolean
default:false

If true, stream partial message deltas using SSE.

stop

Sequences where the model will stop generating further tokens.

Response

Completion generated successfully

id
string
required
Example:

"chatcmpl-abc123"

object
string
required
Example:

"chat.completion"

created
integer
required

Unix timestamp

model
string
required
Example:

"doubao-seed-1-6-vision-250815"

choices
object[]
required
usage
object