TokenRa
English登录注册

文本模型 · Thinking Machines

Inkling 2 Small API 文档

Inkling 2 Small 是 Thinking Machines 在 TokenRa 上较大的那款模型。它会把推理文本随答案一起返回,支持函数调用,默认返回单个 JSON 响应体。

模型 ID
inkling-2-small
接口格式
Chat Completions
输入
文本
输出
文本
定位
中型推理模型
面向 AI 代理
llms.txt 指南

Capabilities

能力与接口

对话生成,走 OpenAI Chat Completions,已于 2026-12-02 在 tokenra.io 实测调用成功。中型推理模型。

POSThttps://tokenra.io/v1/chat/completions已实测
OpenAI SDK 配 base_url="https://tokenra.io/v1",鉴权用 Authorization: Bearer。
本模型不支持
  • Anthropic Messages(/v1/messages):该模型在网关只登记了 openai 接口类型。
  • OpenAI Responses(/v1/responses)同样未开放。

Request

请求参数

POST /v1/chat/completions 的字段,下面列出的都在实测中被模型接受。

参数类型必填说明
modelstring必填要调用的模型 ID,例如 inkling-2-small。
messagesarray必填按顺序排列的对话消息,content 可以是字符串或分段数组。
streamboolean可选默认 false,返回单个 JSON 响应体;传 true 走 SSE。
stream_optionsobject可选传 {"include_usage": true} 时最后一个分片带 usage。
max_tokensinteger可选生成 token 上限,含推理 token。
temperaturenumber可选采样温度。
top_pnumber可选核采样阈值,通常与 temperature 二选一。
toolsarray可选支持。带 tools 的请求返回 tool_calls,finish_reason 为 tool_calls。
userstring可选你自己的终端用户标识,用于审计,不进入对话。
本模型会返回的字段
  • message.reasoning 与 message.reasoning_details[0].text 是推理文本。
  • message.refusal 在模型拒答前为 null。
价格

输入 $0.45 · 输出 $1.50 · 缓存输入 $0.09 / 1M token。Inkling 2 Small 的输入与输出价都是 Inkling 2 Mini 的两倍。Inkling 2 Small 的价格是 Inkling 2 Mini 的两倍,推理链更短。

Response

响应格式

响应示例
{
  "id": "gen-1796172255-k2LmPqRt8YxWvB3nQdHs",
  "model": "thinkingmachines/inkling-2-small",
  "object": "chat.completion",
  "created": 1796172255,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "An API gateway acts as a single entry point for client requests, routing them to the right backend services while applying authentication, rate limiting and monitoring.",
        "refusal": null,
        "reasoning": "The user wants one sentence on what an API gateway does. Keep it short and accurate: entry point, routing, shared policies.",
        "reasoning_details": [
          {
            "type": "reasoning.text",
            "text": "The user wants one sentence on what an API gateway does. Keep it short and accurate: entry point, routing, shared policies."
          }
        ]
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 26,
    "completion_tokens": 115,
    "total_tokens": 141,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    }
  }
}
字段类型说明
idstring本次调用的 ID,联系支持时附上它。
objectstring流式时为 chat.completion.chunk,否则为 chat.completion。
createdintegerUnix 时间戳(秒)。
choices[0].message.contentstring答案正文。
choices[0].finish_reasonstring正常回复为 stop;模型发起函数调用时为 tool_calls。
usage.prompt_tokensinteger输入 token,按输入价计费。
usage.completion_tokensinteger输出 token,按输入价的 5 倍计费。
usage.completion_tokens_details.reasoning_tokensinteger输出 token 里有多少用在推理上,按输出价计费。

Errors

错误与限制

常见错误

HTTPerror.code含义怎么处理
401—API Key 缺失、错误或已删除,消息为 Invalid token。检查 Authorization: Bearer 请求头与控制台里的 Key。
400—请求体不是合法 JSON。修正 JSON,并带上 Content-Type: application/json。
500invalid_request缺少必填字段,例如 messages。补上消息里点名的字段,重试无用。
403insufficient_user_quota余额或套餐额度已用完。在控制台充值后重试。
503model_not_found模型 ID 未知,或当前分组没有可用渠道。在模型列表或 GET /v1/models 里核对 ID。
429—请求过于频繁。指数退避后重试。
5xx—上游供应商失败或超时。重试几次;持续失败请保留请求 ID。

限制与说明

  • 默认返回单个 JSON 响应体;要 SSE 请传 "stream": true。
  • 支持函数调用:带 tools 的请求返回 tool_calls,此时 content 为空。
  • 推理文本在 message.reasoning 与 message.reasoning_details[0].text 中返回,按输出 token 计费。
  • 价格:输入 $0.45、输出 $1.50 / 1M token,缓存输入 $0.09。