API reference
Connect to GPTsAPI with an API key. Find authentication, streaming guidance, and request and response examples for each supported model.
Authentication and base URL
Create an API key in the dashboard after registering and adding credit. Use https://api.gptsapi.net as the API origin; OpenAI-compatible SDKs generally use https://api.gptsapi.net/v1 as their base URL.
Send Authorization: Bearer YOUR_API_KEY. The API also accepts x-api-key. Keep keys on your server or in environment variables, not in browser code. GET /v1/models lists available models.
curl https://api.gptsapi.net/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"Choose the model and protocol
Use the exact model ID and endpoint in the examples below. A shared API key does not mean every model supports every protocol, input type, or parameter. Claude examples include Messages and Chat Completions; other models expose their own supported interfaces.
Tool setup can differ from direct API usage. For example, the Cursor tutorial describes its wild- model aliases. Follow the tutorial for your client rather than applying that alias to every integration.
Streaming responses
For Chat Completions and Messages models that support streaming, set stream to true and read the response incrementally as Server-Sent Events (SSE). curl -N disables output buffering.
Parse SSE events before parsing their JSON payloads. Handle event boundaries, blank lines and comment heartbeats; a comment beginning with a colon is not JSON. Chat Completions ends with [DONE], while Messages uses its event types. Gemini uses streamGenerateContent?alt=sse where supported.
Errors, limits and retries
Check the HTTP status and returned error message. For authentication errors, verify the key and header. For balance or model-access errors, check credit, key limits and model ID. For invalid parameters, compare the request with that model's example.
For HTTP 429, respect Retry-After when present and reduce concurrency. For temporary server errors, use bounded exponential backoff. Do not repeatedly retry invalid requests. Limits depend on the key, model and upstream service; there is no universal unlimited-concurrency guarantee.
For asynchronous image or video tasks, retain the task ID and poll the documented endpoint. Avoid resubmitting a task whose submission status is unknown; follow its model-specific polling and billing notes.
API examples
These examples come from the model documentation. Responses illustrate the format; they are not results of a request made on this page. Replace YOUR_API_KEY and example inputs before use. API calls consume account credit.
claude-sonnet-5-5
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-sonnet-5-5",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-sonnet-5-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}claude-haiku-5-5
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-haiku-5-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-haiku-5-5",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-haiku-5-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-haiku-5-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}claude-fable-5-1
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-fable-5-1",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-fable-5-1",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-fable-5-1",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-fable-5-1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}claude-opus-5-5
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-opus-5-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-opus-5-5",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-opus-5-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-opus-5-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}claude-fable-5-2
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-fable-5-2",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-fable-5-2",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-fable-5-2",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-fable-5-2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}claude-opus-5
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-opus-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-opus-5",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-opus-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-opus-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}claude-sonnet-5
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-sonnet-5",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-sonnet-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}claude-fable-5
Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-fable-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "claude-fable-5",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-fable-5",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "claude-fable-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}gpt-6.2-astra
Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.2-astra",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "gpt-6.2-astra",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.2-astra",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "gpt-6.2-astra",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}gpt-6.1-terra
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.1-terra",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "gpt-6.1-terra",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.1-terra",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "gpt-6.1-terra",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}gpt-6.1-sol
Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.1-sol",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "gpt-6.1-sol",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.1-sol",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "gpt-6.1-sol",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}gpt-6.2-sol
Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.2-sol",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "gpt-6.2-sol",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6.2-sol",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "gpt-6.2-sol",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}gpt-6-astra
Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6-astra",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "gpt-6-astra",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6-astra",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "gpt-6-astra",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}gpt-6-luna
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6-luna",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "gpt-6-luna",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-6-luna",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "gpt-6-luna",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}gpt-image-2.6-flare
Text to image
Request
# 同步等待生成结果,直接返回图片地址和 Token 用量。
# response_format 可选 url 或 b64_json;尺寸使用 size,不传 resolution。
curl 'https://api.gptsapi.net/v1/images/generations' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-image-2.6-flare",
"prompt": "极简图标:纯白背景中央放一个蓝色圆形,无文字。",
"size": "1024x1024",
"quality": "low",
"output_format": "png",
"response_format": "url"
}'Example response
{
"background": "opaque",
"output_format": "png",
"quality": "low",
"size": "1024x1024",
"safety_identifier": null,
"data": [
{
"url": "https://example.com/result.png",
"generation_id": "00000000-0000-4000-8000-000000000001"
}
],
"created": 1794905313,
"usage": {
"input_tokens": 24,
"output_tokens": 824,
"input_tokens_details": {
"text_tokens": 24,
"image_tokens": 0
},
"output_tokens_details": {
"text_tokens": 0,
"image_tokens": 824
},
"total_tokens": 848
}
}Image to image
Request
# 将 ./input.png 替换为本地原图路径,使用 multipart 上传文件。
# 多张参考图可重复添加 --form 'image[]=@./参考图.png',可选上传 mask 文件。
# size、quality、response_format 与文生图一致。
# 不要手动设置 Content-Type,cURL 会生成包含 boundary 的请求头。
curl 'https://api.gptsapi.net/v1/images/edits' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--form 'model=gpt-image-2.6-flare' \
--form 'prompt=把图中的蓝色圆形改成红色,保留纯白背景、圆形的形状、大小和位置,不要添加其他元素或文字。' \
--form 'image=@./input.png' \
--form 'size=1024x1024' \
--form 'quality=low' \
--form 'output_format=png' \
--form 'response_format=url'Example response
{
"background": "opaque",
"output_format": "png",
"quality": "low",
"size": "1024x1024",
"safety_identifier": null,
"data": [
{
"url": "https://example.com/result.png",
"generation_id": "00000000-0000-4000-8000-000000000001"
}
],
"created": 1794905313,
"usage": {
"input_tokens": 1075,
"output_tokens": 824,
"input_tokens_details": {
"text_tokens": 51,
"image_tokens": 1024
},
"output_tokens_details": {
"text_tokens": 0,
"image_tokens": 824
},
"total_tokens": 1899
}
}tts-1
Audio
文本转语音 (Speech / TTS)
curl https://api.gptsapi.net/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "tts-1",
"voice": "onyx",
"input": "你好,这是一段测试文本"
}' \
--output speech.mp3Example response
返回音频文件(MP3格式)
语音转文本 (Transcriptions / STT)
curl https://api.gptsapi.net/v1/audio/transcriptions \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "model=tts-1"Example response
{
"text": "转录的文本内容"
}tts-1-hd
Audio
文本转语音 (Speech / TTS)
curl https://api.gptsapi.net/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "tts-1-hd",
"voice": "onyx",
"input": "你好,这是一段测试文本"
}' \
--output speech.mp3Example response
返回音频文件(MP3格式)
语音转文本 (Transcriptions / STT)
curl https://api.gptsapi.net/v1/audio/transcriptions \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "model=tts-1-hd"Example response
{
"text": "转录的文本内容"
}whisper-1
Speech / TTS
Request
curl https://api.gptsapi.net/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "tts-1",
"voice": "onyx",
"input": "你好,这是一段测试文本"
}' \
--output speech.mp3Example response
返回音频文件(MP3格式)
Transcriptions / STT
Request
curl https://api.gptsapi.net/v1/audio/transcriptions \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "model=tts-1"Example response
{
"text": "转录的文本内容"
}glm-5.2
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "glm-5.2",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "glm-5.2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}kimi-k2.7-code
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "kimi-k2.7-code",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "kimi-k2.7-code",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}kimi-k2.6
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "kimi-k2.6",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "kimi-k2.6",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}kimi-k3
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "kimi-k3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}gemini-4-carbon
Gemini non-stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-4-carbon:generateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "我是 Gemini,由 Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 3,
"candidatesTokenCount": 11,
"thoughtsTokenCount": 154,
"totalTokenCount": 168,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 11
}
]
},
"modelVersion": "gemini-4-carbon",
"createTime": "2025-12-03T08:56:57.468468Z",
"responseId": "WfsvafTLHNKTq7UPydaJ8QM"
}Gemini stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-4-carbon:streamGenerateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"parts": [
{
"text": "我是 Gemini,Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"createTime": "2025-12-03T08:55:11.771327Z",
"modelVersion": "gemini-4-carbon",
"responseId": "7_ovaf-JL-e54_UP_umfsAU",
"usageMetadata": {
"candidatesTokenCount": 10,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 10
}
],
"promptTokenCount": 3,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"thoughtsTokenCount": 118,
"totalTokenCount": 131,
"trafficType": "ON_DEMAND"
}
}gemini-4-hydrogen
Gemini non-stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-4-hydrogen:generateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "我是 Gemini,由 Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 3,
"candidatesTokenCount": 11,
"thoughtsTokenCount": 154,
"totalTokenCount": 168,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 11
}
]
},
"modelVersion": "gemini-4-hydrogen",
"createTime": "2025-12-03T08:56:57.468468Z",
"responseId": "WfsvafTLHNKTq7UPydaJ8QM"
}Gemini stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-4-hydrogen:streamGenerateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"parts": [
{
"text": "我是 Gemini,Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"createTime": "2025-12-03T08:55:11.771327Z",
"modelVersion": "gemini-4-hydrogen",
"responseId": "7_ovaf-JL-e54_UP_umfsAU",
"usageMetadata": {
"candidatesTokenCount": 10,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 10
}
],
"promptTokenCount": 3,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"thoughtsTokenCount": 118,
"totalTokenCount": 131,
"trafficType": "ON_DEMAND"
}
}gemini-4-neon
Gemini non-stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-4-neon:generateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "我是 Gemini,由 Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 3,
"candidatesTokenCount": 11,
"thoughtsTokenCount": 154,
"totalTokenCount": 168,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 11
}
]
},
"modelVersion": "gemini-4-neon",
"createTime": "2025-12-03T08:56:57.468468Z",
"responseId": "WfsvafTLHNKTq7UPydaJ8QM"
}Gemini stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-4-neon:streamGenerateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"parts": [
{
"text": "我是 Gemini,Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"createTime": "2025-12-03T08:55:11.771327Z",
"modelVersion": "gemini-4-neon",
"responseId": "7_ovaf-JL-e54_UP_umfsAU",
"usageMetadata": {
"candidatesTokenCount": 10,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 10
}
],
"promptTokenCount": 3,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"thoughtsTokenCount": 118,
"totalTokenCount": 131,
"trafficType": "ON_DEMAND"
}
}gemini-3.8-flash
Gemini non-stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-3.8-flash:generateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "我是 Gemini,由 Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 3,
"candidatesTokenCount": 11,
"thoughtsTokenCount": 154,
"totalTokenCount": 168,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 11
}
]
},
"modelVersion": "gemini-3.8-flash",
"createTime": "2025-12-03T08:56:57.468468Z",
"responseId": "WfsvafTLHNKTq7UPydaJ8QM"
}Gemini stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-3.8-flash:streamGenerateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"parts": [
{
"text": "我是 Gemini,Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"createTime": "2025-12-03T08:55:11.771327Z",
"modelVersion": "gemini-3.8-flash",
"responseId": "7_ovaf-JL-e54_UP_umfsAU",
"usageMetadata": {
"candidatesTokenCount": 10,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 10
}
],
"promptTokenCount": 3,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"thoughtsTokenCount": 118,
"totalTokenCount": 131,
"trafficType": "ON_DEMAND"
}
}gemini-3.5-flash-lite
Gemini non-stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-3.5-flash-lite:generateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "我是 Gemini,由 Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 3,
"candidatesTokenCount": 11,
"thoughtsTokenCount": 154,
"totalTokenCount": 168,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 11
}
]
},
"modelVersion": "gemini-3.5-flash-lite",
"createTime": "2025-12-03T08:56:57.468468Z",
"responseId": "WfsvafTLHNKTq7UPydaJ8QM"
}Gemini stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-3.5-flash-lite:streamGenerateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"parts": [
{
"text": "我是 Gemini,Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"createTime": "2025-12-03T08:55:11.771327Z",
"modelVersion": "gemini-3.5-flash-lite",
"responseId": "7_ovaf-JL-e54_UP_umfsAU",
"usageMetadata": {
"candidatesTokenCount": 10,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 10
}
],
"promptTokenCount": 3,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"thoughtsTokenCount": 118,
"totalTokenCount": 131,
"trafficType": "ON_DEMAND"
}
}Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemini-3.5-flash-lite",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "gemini-3.5-flash-lite",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemini-3.5-flash-lite",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "gemini-3.5-flash-lite",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}gemini-3.1-flash-image-preview
Text to image
Request
curl --location --request POST 'https://api.gptsapi.net/api/v3/google/gemini-3.1-flash-image-preview/text-to-image' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "生成一张火烧云图片",
"aspect_ratio": "1:1",
"output_format": "png"
}'Example response
{
"data": {
"id": "{result_id}",
"model": "gemini-3.1-flash-image-preview",
"outputs": [],
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
},
"hasNsfwContents": [],
"status": "created",
"createdAt": "2025-11-21 20:43:19",
"executionTime": 0,
"timings": {
"inference": 0
}
},
"message": "success",
"code": 200,
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
}
}Image to image
Request
curl --location --request POST 'https://api.gptsapi.net/api/v3/google/gemini-3.1-flash-image-preview/image-edit' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "Combine two images, making Obama the main character of the poster, and replace the PLuribus text with GPT PROTO.",
"images": [
"https://example.com/image1.png",
"https://example.com/image2.jpg"
],
"output_format": "jpeg"
}'Example response
{
"data": {
"id": "{result_id}",
"model": "gemini-3.1-flash-image-preview",
"outputs": [],
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
},
"hasNsfwContents": [],
"status": "created",
"createdAt": "2025-11-21 20:43:19",
"executionTime": 0,
"timings": {
"inference": 0
}
},
"message": "success",
"code": 200,
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
}
}Query result
Request
curl --location --request GET 'https://api.gptsapi.net/api/v3/predictions/{result_id}/result' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'Example response
{
"data": {
"id": "{result_id}",
"model": "gemini-3.1-flash-image-preview",
"outputs": [
"https://example.com/result.png"
],
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
},
"status": "completed",
"error": null,
"executionTime": 0,
"timings": {
"inference": 0
},
"has_nsfw_contents": [],
"created_at": "2025-11-21 20:43:50"
},
"message": "success",
"code": 200,
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
}
}gemini-3-pro-image-preview
Text to image
Request
curl --location --request POST 'https://api.gptsapi.net/api/v3/google/gemini-3-pro-image-preview/text-to-image' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "生成一张火烧云图片",
"aspect_ratio": "1:1",
"output_format": "png"
}'Example response
{
"data": {
"id": "{result_id}",
"model": "gemini-3-pro-image-preview",
"outputs": [],
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
},
"hasNsfwContents": [],
"status": "created",
"createdAt": "2025-11-21 20:43:19",
"executionTime": 0,
"timings": {
"inference": 0
}
},
"message": "success",
"code": 200,
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
}
}Image to image
Request
curl --location --request POST 'https://api.gptsapi.net/api/v3/google/gemini-3-pro-image-preview/image-edit' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "Combine two images, making Obama the main character of the poster, and replace the PLuribus text with GPT PROTO.",
"images": [
"https://example.com/image1.png",
"https://example.com/image2.jpg"
],
"output_format": "jpeg"
}'Example response
{
"data": {
"id": "{result_id}",
"model": "gemini-3-pro-image-preview",
"outputs": [],
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
},
"hasNsfwContents": [],
"status": "created",
"createdAt": "2025-11-21 20:43:19",
"executionTime": 0,
"timings": {
"inference": 0
}
},
"message": "success",
"code": 200,
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
}
}Query result
Request
curl --location --request GET 'https://api.gptsapi.net/api/v3/predictions/{result_id}/result' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'Example response
{
"data": {
"id": "{result_id}",
"model": "gemini-3-pro-image-preview",
"outputs": [
"https://example.com/result.png"
],
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
},
"status": "completed",
"error": null,
"executionTime": 0,
"timings": {
"inference": 0
},
"has_nsfw_contents": [],
"created_at": "2025-11-21 20:43:50"
},
"message": "success",
"code": 200,
"urls": {
"get": "https://api.gptsapi.net/api/v3/predictions/{result_id}/result"
}
}gemini-3.1-pro-preview
Gemini stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-3.1-pro-preview:streamGenerateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"parts": [
{
"text": "我是 Gemini,Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"createTime": "2025-12-03T08:55:11.771327Z",
"modelVersion": "gemini-3.1-pro-preview",
"responseId": "7_ovaf-JL-e54_UP_umfsAU",
"usageMetadata": {
"candidatesTokenCount": 10,
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 10
}
],
"promptTokenCount": 3,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"thoughtsTokenCount": 118,
"totalTokenCount": 131,
"trafficType": "ON_DEMAND"
}
}Gemini non-stream
Request
curl --location --request POST 'https://api.gptsapi.net/v1beta/models/gemini-3.1-pro-preview:generateContent' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "你是谁?"
}
]
}
]
}'Example response
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "我是 Gemini,由 Google 开发的大型语言模型。",
"thoughtSignature": "..."
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 3,
"candidatesTokenCount": 11,
"thoughtsTokenCount": 154,
"totalTokenCount": 168,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 3
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 11
}
]
},
"modelVersion": "gemini-3.1-pro-preview",
"createTime": "2025-12-03T08:56:57.468468Z",
"responseId": "WfsvafTLHNKTq7UPydaJ8QM"
}Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemini-3.1-pro-preview",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "gemini-3.1-pro-preview",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemini-3.1-pro-preview",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "gemini-3.1-pro-preview",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}deepseek-v4.1-flash-1017
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-v4.1-flash-1017",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "deepseek-v4.1-flash-1017",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}deepseek-v4.1-flash
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "deepseek-v4.1-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}deepseek-v4-pro
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "deepseek-v4-pro",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}grok-4.7
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-4.7",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "grok-4.7",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-4.7",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "grok-4.7",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-4.7",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "grok-4.7",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}grok-code-fast-1
Chat
Request
curl https://api.gptsapi.net/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-code-fast-1",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "chatcmpl-1796355481",
"object": "chat.completion",
"created": 1796355481,
"model": "grok-code-fast-1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我可以帮你做什么?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 7,
"completion_tokens": 39,
"total_tokens": 46
}
}Messages
Request
curl https://api.gptsapi.net/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-code-fast-1",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 1000
}'Example response
{
"id": "msg_1796355481",
"model": "grok-code-fast-1",
"role": "assistant",
"type": "message",
"content": [
{
"type": "text",
"text": "您好!很高兴与您交谈。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 24,
"output_tokens": 71
}
}Responses
Request
curl https://api.gptsapi.net/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-code-fast-1",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"max_tokens": 1000
}'Example response
{
"id": "resp_1796355481",
"object": "response",
"model": "grok-code-fast-1",
"status": "completed",
"output": [
{
"id": "msg_1796355481",
"role": "assistant",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "你好!有什么我可以帮你的吗?"
}
]
}
],
"usage": {
"input_tokens": 7,
"output_tokens": 167,
"total_tokens": 174
}
}grok-imagine-image
Image generation
Request
curl https://api.gptsapi.net/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-imagine-image",
"prompt": "A cute baby sea otter",
"n": 2,
"size": "1024x1024",
"quality": "low"
}'Example response
{
"created": 1765956035,
"background": "opaque",
"data": [
{
"b64_json": "xxx"
},
{
"b64_json": "xxx"
}
],
"output_format": "png",
"quality": "low",
"size": "1024x1024",
"usage": {
"input_tokens": 166,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 166
},
"output_tokens": 912,
"output_tokens_details": {
"image_tokens": 544,
"text_tokens": 368
},
"total_tokens": 1078
}
}doubao-seedance-2-5-260628
Video generation
Create a video task
curl 'https://api.gptsapi.net/v1/videos' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "doubao-seedance-2-5-260628",
"prompt": "清晨的湖面上,一只白鹭缓缓起飞,镜头平稳跟拍。",
"seconds": 5,
"resolution": "720p"
}'Example response
{
"id": "video_示例任务编号",
"object": "video",
"model": "doubao-seedance-2-5-260628",
"status": "queued",
"progress": 0
}Check task progress
curl 'https://api.gptsapi.net/v1/videos/video_示例任务编号' \
--header 'Authorization: Bearer YOUR_API_KEY'Example response
{
"id": "video_示例任务编号",
"object": "video",
"model": "doubao-seedance-2-5-260628",
"status": "completed",
"progress": 100,
"seconds": "5",
"size": "1280x720",
"resolution": "720p",
"usage": {
"completion_tokens": 108900,
"total_tokens": 108900
}
}Download the settled video
curl --location 'https://api.gptsapi.net/v1/videos/video_示例任务编号/content' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--output video.mp4Example response
Set seconds to 4–30 or -1. The default is 5. per_video_token selects an output token rate based on resolution and whether a reference video is present. An estimated charge is reserved when the task is created, using 30 seconds for automatic duration and reference video duration. The final charge uses usage.completion_tokens. Failed tasks get a full refund. If valid usage is missing, the task stays pending settlement and downloads are unavailable. Poll every 5–15 seconds. The download expires at expires_at. If the API returns 202 with submission_status=unknown, keep the task ID and avoid submitting again.
Use image, video, and audio references
curl 'https://api.gptsapi.net/v1/videos' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "doubao-seedance-2-5-260628",
"prompt": "以图片1的产品为主角,参考视频1的镜头节奏,配合音频1的音乐,制作广告。",
"seconds": 10,
"resolution": "720p",
"ratio": "16:9",
"content": [
{
"type": "image_url",
"role": "reference_image",
"image_url": {
"url": "https://example.com/product.png"
}
},
{
"type": "video_url",
"role": "reference_video",
"video_url": {
"url": "https://example.com/camera.mp4"
}
},
{
"type": "audio_url",
"role": "reference_audio",
"audio_url": {
"url": "https://example.com/bgm.mp3"
}
}
]
}'Example response
Reference URLs must be publicly accessible to the provider. Base64 is unsupported. Use first_frame and last_frame for boundary frames, use ratio=adaptive, and keep them separate from other references. To edit or extend a video, set omni_reference_task_type to edit or extend and provide a reference video with ratio=adaptive. For edit, set seconds to -1.
Billing and data
Prepaid credit funds API usage. Refund and inactivity-expiry conditions are described in the Terms. Request-content exceptions and operational metadata retention are described in the Privacy Policy.