大模型

ai-chatPOST
POSThttps://v1.apizero.cn/api/ai-chat
收费档

默认经济档(最低)。适中、较贵同一模型价更高。

加载中…

概述

一把 Key 调对话、生图、视频。地址 POST https://v1.apizero.cn/v1/chat/completions,SDK base 填 https://v1.apizero.cn/v1。默认经济档(最低),也可选适中或较贵。成功后按 Token / 任务价扣大模型额度。

调用约定

  • 网关 · https://v1.apizero.cn
  • 鉴权 · Authorization: Bearer <API Key>
  • 回包 · JSON {code, msg, data}。成功看 code === 0,不要只看 HTTP 200。
/aidocs/ai-chat/raw.md
打开 Markdown

鉴权

未携带 API Key:无 · QPS 1;已登录(未开通会员):本接口没有登录免费额度;试用:无;黄金会员:本档不提供 VIP 额度 · QPS 10;钻石会员:本档不提供 VIP 额度 · QPS 30;企业会员:本档不提供 VIP 额度 · QPS 60;点数:本接口按用量结算,不从点数扣减;按用量。

获取 API Key

请求头

Authorizationstring必填

必填鉴权。推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。付费接口需携带有效 Key。

对话

POSTAPPLICATION/JSON·APPLICATION/JSON

多轮对话走同一 Completions 地址。stream 不传或 false:整段 chat.completion JSON。stream 为 true:SSE,每块是 chat.completion.chunk,结束前有 data: [DONE]。本站计费在最后的 usage.apizero。同一条网关也接 POST /v1/responses。默认经济档。

https://v1.apizero.cn/v1/chat/completions?model=deepseek-v4-flash-0731&tier=economy&messages=%5B%7B%22role%22%3A%22user%22%2C%22content%22%3A%22%E7%94%A8%E4%B8%80%E5%8F%A5%E8%AF%9D%E4%BB%8B%E7%BB%8D%E6%9E%81%E6%95%B0%E6%9C%AC%E6%BA%90%22%7D%5D&stream=false

model(模型)string必填

对话模型 ID,见本页模型表或 ?type=chat

例deepseek-v4-flash-0731

tier(收费档)string选填

收费档:economy 经济(默认、最低)/ standard 适中 / plus 较贵。不传按经济档

例economy

messages(对话消息)array必填

OpenAI 风格 messages,可带历史轮次

例[{"role":"user","content":"用一句话介绍极数本源"}]

stream(流式)boolean选填

false 返回整段 JSON。true 按 SSE 推 chat.completion.chunk,最后一块 usage.apizero 是本站扣费

例false

{
  "model": "deepseek-v4-flash-0731",
  "tier": "economy",
  "messages": "[{\"role\":\"user\",\"content\":\"用一句话介绍极数本源\"}]",
  "stream": "false"
}

返回结果

idstring

本次请求 ID

objectstring

固定 chat.completion

creatednumber

生成时间 Unix 秒

modelstring

实际使用的模型 ID

choicesarray

模型输出。对话在 choices[0].message.content;生图/视频常见为链接或任务信息

indexnumber

index

messageobject

message

rolestring

role

contentstring

内容

finish_reasonstring

finish_reason

usageobject

官方用量:prompt_tokens / completion_tokens / total_tokens。本站计费在 usage.apizero(request_id、tier、billing.cost_fen / cost_yuan)

apizeroobject

本站附加。tier 为计费档;billing 含 cost_fen、cost_yuan、pricing_used、input_fen_per_m、output_fen_per_m。生图未完成时还有 task_id、status=pending

request_idstring

request_id

tierstring

tier

billingobject

billing

cost_fennumber

cost_fen

cost_yuannumber

cost_yuan

pricing_usednumber

pricing_used

{
  "id": "chatcmpl-demo",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "极数本源提供统一 Key 的 API 与大模型接入。"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 16,
    "completion_tokens": 18,
    "total_tokens": 34,
    "apizero": {
      "request_id": "mur2uu3g84c2c488",
      "tier": "economy",
      "billing": {
        "cost_fen": 0.021,
        "cost_yuan": 0.00021,
        "pricing_used": 1
      }
    }
  }
}

生图

POSTAPPLICATION/JSON·APPLICATION/JSON

仍 POST /v1/chat/completions,只把 model 换成生图模型。提示词写在 messages 里。不要和商城里单独的豆包文生图接口混用。默认经济档。

https://v1.apizero.cn/v1/chat/completions?model=qwen-image&tier=economy&messages=%5B%7B%22role%22%3A%22user%22%2C%22content%22%3A%22%E4%B8%80%E5%8F%AA%E6%A9%98%E7%8C%AB%E5%9D%90%E5%9C%A8%E7%AA%97%E5%8F%B0%E4%B8%8A%EF%BC%8C%E5%8D%88%E5%90%8E%E9%98%B3%E5%85%89%EF%BC%8C%E5%86%99%E5%AE%9E%22%7D%5D

model(模型)string必填

生图模型 ID,见本页模型表或 ?type=image

例qwen-image

tier(收费档)string选填

收费档:economy 经济(默认、最低)/ standard 适中 / plus 较贵。不传按经济档

例economy

messages(对话消息)array必填

user content 即生图提示词

例[{"role":"user","content":"一只橘猫坐在窗台上,午后阳光,写实"}]

{
  "model": "qwen-image",
  "tier": "economy",
  "messages": "[{\"role\":\"user\",\"content\":\"一只橘猫坐在窗台上,午后阳光,写实\"}]"
}

返回结果

idstring

本次请求 ID

objectstring

固定 chat.completion

creatednumber

生成时间 Unix 秒

modelstring

实际使用的模型 ID

choicesarray

模型输出。对话在 choices[0].message.content;生图/视频常见为链接或任务信息

indexnumber

index

messageobject

message

rolestring

role

contentstring

内容

finish_reasonstring

finish_reason

usageobject

官方用量:prompt_tokens / completion_tokens / total_tokens。本站计费在 usage.apizero(request_id、tier、billing.cost_fen / cost_yuan)

apizeroobject

本站附加。tier 为计费档;billing 含 cost_fen、cost_yuan、pricing_used、input_fen_per_m、output_fen_per_m。生图未完成时还有 task_id、status=pending

request_idstring

request_id

tierstring

tier

billingobject

billing

cost_fennumber

cost_fen

cost_yuannumber

cost_yuan

{
  "id": "chatcmpl-img",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "https://example.com/generated.png"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 8,
    "total_tokens": 32,
    "apizero": {
      "request_id": "mur2uu3g84c2c488",
      "tier": "economy",
      "billing": {
        "cost_fen": 12,
        "cost_yuan": 0.12
      }
    }
  }
}

视频

POSTAPPLICATION/JSON·APPLICATION/JSON

仍 POST /v1/chat/completions,只把 model 换成视频模型。提示词写在 messages 里。有的模型按次/按时长计价,以价目表为准。默认经济档。

https://v1.apizero.cn/v1/chat/completions?model=viduq3&tier=economy&messages=%5B%7B%22role%22%3A%22user%22%2C%22content%22%3A%22%E4%B8%80%E5%8F%AA%E9%87%91%E6%AF%9B%E5%9C%A8%E8%8D%89%E5%9C%B0%E4%B8%8A%E5%A5%94%E8%B7%91%EF%BC%8C%E6%85%A2%E9%95%9C%E5%A4%B4%EF%BC%8C%E9%98%B3%E5%85%89%22%7D%5D

model(模型)string必填

视频模型 ID,见本页模型表或 ?type=video

例viduq3

tier(收费档)string选填

收费档:economy 经济(默认、最低)/ standard 适中 / plus 较贵。不传按经济档

例economy

messages(对话消息)array必填

user content 即视频提示词

例[{"role":"user","content":"一只金毛在草地上奔跑,慢镜头,阳光"}]

{
  "model": "viduq3",
  "tier": "economy",
  "messages": "[{\"role\":\"user\",\"content\":\"一只金毛在草地上奔跑,慢镜头,阳光\"}]"
}

返回结果

idstring

本次请求 ID

objectstring

固定 chat.completion

creatednumber

生成时间 Unix 秒

modelstring

实际使用的模型 ID

choicesarray

模型输出。对话在 choices[0].message.content;生图/视频常见为链接或任务信息

indexnumber

index

messageobject

message

rolestring

role

contentstring

内容

finish_reasonstring

finish_reason

usageobject

官方用量:prompt_tokens / completion_tokens / total_tokens。本站计费在 usage.apizero(request_id、tier、billing.cost_fen / cost_yuan)

apizeroobject

本站附加。tier 为计费档;billing 含 cost_fen、cost_yuan、pricing_used、input_fen_per_m、output_fen_per_m。生图未完成时还有 task_id、status=pending

request_idstring

request_id

tierstring

tier

billingobject

billing

cost_fennumber

cost_fen

cost_yuannumber

cost_yuan

{
  "id": "chatcmpl-vid",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "https://example.com/generated.mp4"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 6,
    "total_tokens": 26,
    "apizero": {
      "request_id": "mur2uu3g84c2c488",
      "tier": "economy",
      "billing": {
        "cost_fen": 40,
        "cost_yuan": 0.4
      }
    }
  }
}

模型列表

GETURL QUERY·APPLICATION/JSON

公开价目,不用 Key。type 可筛 chat / image / video / audio。每条带三档价格,挂牌和调试默认看 economy。调用时仍走 /v1/chat/completions。

https://config.apizero.cn/api/v1/public/ai-models?type=chat&q=deepseek

type(类型)string选填

chat / image / video / audio,不传返回全部

例chat

q(搜索)string选填

按模型 ID 或名称搜索

例deepseek

返回结果

totalnumber

条数

modelsarray

模型列表,含 id / name / type / prices.economy|standard|plus

idstring

id

namestring

名称

typestring

类型

pricesobject

prices

economyobject

economy

standardstring

standard

plusstring

plus

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "ok",
  "data": {
    "total": 1,
    "models": [
      {
        "id": "deepseek-v4-flash-0731",
        "name": "DeepSeek V4 Flash",
        "type": "chat",
        "prices": {
          "economy": {
            "label": "经济",
            "available": true,
            "sell": {
              "input": 0.5,
              "output": 2,
              "billing": "per_token"
            }
          },
          "standard": null,
          "plus": null
        }
      }
    ]
  },
  "tips": "极数本源 · https://apizero.cn"
}

请求示例

示例都是服务端写法。Python / JavaScript 各有常规写法和官方库。

curl -sS -X POST "https://v1.apizero.cn/api/ai-chat" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

错误码

先看业务 code。HTTP 也可能不是 200。

0200

成功

4000400

参数错误

4011401

API Key 无效

4013403

API Key 已暂停

4014403

当前 IP 不在 Key 白名单

4015401

此接口需要 API Key

4022402

余额不足

4029429

调用过快(QPS)

4030429

今日免费额度已用完

4040503

接口已下线

4041404

接口不存在

5000500

服务器内部错误

5020502

上游暂时不可用

5021502

上游返回格式异常

5030502

暂无可用节点

调用限制

计费模式
按次付费 · 点数包 · 月套餐
QPS 限制
QPS 0
登录免费额度
无
匿名每日额度
无
黄金会员
本档不提供 VIP 额度 · QPS 10
钻石会员
本档不提供 VIP 额度 · QPS 30
企业会员
本档不提供 VIP 额度 · QPS 60

购买套餐、看评价请走商城详情。 购买 / 调试

更新日志

暂无变更记录。

免责声明

本接口用来开通大模型调用(对话、生图、视频),成功后按实际用量计费,不按 VIP 额度结算。

并不是所有会员都有额度。只有企业会员附带大模型额度(月付 ¥49.9,年付按 12 个月)。黄金会员、钻石会员没有这笔额度。没有企业额度或大模型月卡时,账户余额不够就会拒绝调用。

生成内容由模型输出,不代表平台观点。请勿用于违法或侵权用途。

大模型 接入文档|极数本源