Skip to main content
POST
/
api
/
v3
/
chat
/
completions
Text to Text
curl --request POST \
  --url https://gptproto.com/api/v3/chat/completions \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "messages": [
    {}
  ],
  "temperature": 123,
  "top_p": 123,
  "max_tokens": 123,
  "stream": true,
  "frequency_penalty": 123,
  "presence_penalty": 123,
  "stop": [
    {}
  ]
}'
{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error",
    "code": "invalid_parameters"
  }
}

Overview

This endpoint provides text to text functionality using Volcengine official format.

Authentication

This endpoint requires authentication using a Bearer token with your API key.
Authorization
string
required
Your API key in the format: Bearer YOUR_API_KEY

Request Body

model
string
default:"doubao-seed-1-6-thinking-250615"
required
The endpoint ID for the model. Format: ep-xxxxxxxxxx-xxxxx
messages
array
default:"[{'role': 'user', 'content': 'Who are you?'}]"
required
Array of message objects for the conversation. Each message must have a role (system, user, or assistant) and content.
temperature
number
default:"0.7"
Controls randomness in the output. Range: 0.0 to 1.0
top_p
number
default:"0.9"
Nucleus sampling parameter. Range: 0.0 to 1.0
max_tokens
integer
default:"2048"
The maximum number of tokens to generate
stream
boolean
default:"false"
Whether to stream the response using SSE (Server-Sent Events)
frequency_penalty
number
default:"0.0"
Penalize frequent tokens. Range: -2.0 to 2.0
presence_penalty
number
default:"0.0"
Penalize new tokens based on presence. Range: -2.0 to 2.0
stop
array
Up to 4 sequences where the API will stop generating further tokens

Request Example

curl -X POST "https://gptproto.com/api/v3/chat/completions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "doubao-seed-1-6-thinking-250615",
  "messages": [
    {
      "role": "user",
      "content": "Hello, please introduce yourself"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 2048
}'

Response

Success
200
Successful response with Volcengine Doubao format
{
  "id": "chatcmpl-xxxxxxxxxx",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "doubao-seed-1-6-thinking-250615",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm Doubao, an AI assistant developed by ByteDance."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 20,
    "total_tokens": 32
  }
}

Error Responses

{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error",
    "code": "invalid_parameters"
  }
}