> ## Documentation Index
> Fetch the complete documentation index at: https://omnirelay.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Responses 与向量接口

> 无状态 Responses、流事件与已核验向量模型的接入规则。

使用自己的推理 Key 查询 `GET /v1/models`，以 `capabilities.responses` 和 `capabilities.embeddings` 判断可用协议。工作空间、Key 模型白名单、限流、钱包和预算共用现有规则。

## Responses

所有可调用 GPT 路由按文档接入 `POST /v1/responses` 的 JSON 和 SSE。设置 `store: false`，在 `input` 中传入完整历史；不支持已存储响应、`previous_response_id`、后台处理、托管工具和 WebSocket。

```bash theme={null}
curl https://api.omnirelay.ai/v1/responses \
  -H "Authorization: Bearer $OMNIRELAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"gpt-6-luna","input":"简短回答。","store":false,"max_output_tokens":64}'
```

`input` 接受文本，或显式消息、`function_call`、`function_call_output` 历史。函数工具使用 Responses 的平铺格式：`{type: "function", name, parameters}`。工具由你的应用执行。GPT 文档合同已支持严格工具和指定函数选择。`tool_choice` 可使用 `"auto"`、`"none"`、`"required"`；指定函数名还要求 `capabilities.named_tool_choice`。JSON 输出使用 `text.format`，可选 `json_object` 或带 `name`、`schema` 及可选 `strict: true` 的 `json_schema`。

添加 `stream: true` 接收具名 SSE 事件，例如 `response.created`、`response.output_text.delta`、`response.function_call_arguments.delta`、`response.completed`。输出达到长度限制时以 `response.incomplete` 结束。最终响应包含有效 `usage` 和已结算的 `cost_microusd`。`input_tokens_details` 保留 `cached_tokens` 和 `cache_write_tokens`，均包含在总输入 Token 内。失败输出 `error`，没有完成事件；关闭 SDK 自动重试，并用 `X-Request-ID` 查询诊断。

## Embeddings

`POST /v1/embeddings` 已实现已核验向量模型合同的执行流程。**当前没有开通向量模型。** 模型、维度、整次请求输入硬上限及输入价格完成核验前，模型列表不会宣称支持向量。

已开通模型的 `input` 可传文本、文本批量、Token ID 或 Token ID 批量，批量大小受 `limits.embedding_inputs` 限制。`encoding_format` 当前仅支持 `float`。`dimensions` 要求模型明确支持可调整维度，否则省略。响应包含按输入顺序排列的有限数值向量、输入用量和最终费用，不增加输出 Token 费用。

推理请求体上限为 4 MiB，最多 2,000 条消息或输入项，详见[限流](https://omnirelay.ai/docs/cn/overview/rate-limits.md)。派发前预留费用，仅依据有效最终用量结算。详见[模型列表](https://omnirelay.ai/docs/cn/llms/listing-models.md)、[用量与计费](https://omnirelay.ai/docs/cn/general/usage-billing.md)和[错误处理](https://omnirelay.ai/docs/cn/general/errors.md)。

## GPT 5.6 Sol Responses

`gpt-5.6-sol` 的 Responses 支持函数工具、严格定义、指定函数、并行调用、JSON object/schema、普通 JSON 与 SSE。`reasoning.effort` 接受 `none`、`low`、`medium`、`high`、`xhigh`、`max`，这些强度可与函数工具组合；默认仍为 `none`。此接口没有 Chat 的工具必须配合 `none` 限制。采样参数仍需使用 `none`。

```json theme={null}
{"model":"gpt-5.6-sol","input":"Reply with exactly: OK.","store":false,"reasoning":{"effort":"low"},"max_output_tokens":1024}
```

当前接入是无状态协议，返回函数调用与最终文本，保留模型的 reasoning 输出项（含可回传的加密历史），不开放托管工具。每轮需传完整对话及显式函数调用／结果。更高推理强度会消耗同一输出预算（包括隐藏推理 Token），平台 4,096 Token 上限仍生效。新增参数组合尚待逐项真实调用验证。

普通 Responses 参数与原生 input/output、reasoning 项直接转发；`store:false` 下可回传加密推理历史。平台保留鉴权、预算与最终用量结算。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.