AnyInt Docs
API 参考

OpenAI 扩展端点

OpenAI 兼容聊天之外的扩展端点地图,包括 embeddings、图像、音频、文件、批处理、Assistants、Threads 和视频。

这些路由使用 OpenAI 兼容前缀,但不是推荐的第一条集成路径。当你的客户端已经依赖这些 OpenAI API 形态,或工作流明确需要它们时再使用。

状态

Pass-through。请求和响应通常跟随所选模型或提供方的 OpenAI/LiteLLM 兼容行为。生产前请针对目标模型逐条验证。

Base URL 与认证

https://api.anyint.ai/openai/v1
Authorization: Bearer <ANYINT_API_KEY>
Content-Type: application/json

路由

路由常见用途
POST /embeddings生成向量 embedding
POST /images/generations生成图像;Kling 模型 ID 可通过 Transtreams 适配
POST /audio/speech文本转语音
POST /audio/transcriptions语音转文本
POST /audio/translations音频翻译
POST /moderations内容审核
/files, /files/{file_id}, /files/{file_id}/contentOpenAI 兼容文件操作
/assistants, /assistants/{assistant_id}上游启用时的 Assistants API 透传
/threads, /threads/{thread_id}, /threads/{thread_id}/messages, /threads/{thread_id}/runs上游启用时的 Threads 和 Runs 透传
/batches, /batches/{batch_id}, /batches/{batch_id}/cancel上游启用时的批处理任务透传
/videos, /videos/{video_id}, /videos/{video_id}/contentOpenAI 风格视频生成和查询

Embeddings 示例

Embeddings 请求字段

字段类型必填含义示例
model字符串当前账号可用的 embedding 模型 ID。text-embedding-v4
input字符串或数组要生成 embedding 的文本或文本列表。AnyInt routes one application...
encoding_format字符串支持时的向量编码格式。float
dimensions整数模型支持时请求的向量维度。1024
user字符串客户侧终端用户标识,用于追踪或滥用监控。user_123
curl https://api.anyint.ai/openai/v1/embeddings \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-v4",
    "input": "AnyInt routes one application through multiple model families."
  }'

Embeddings 响应字段

字段含义
data[].embeddingEmbedding 向量
data[].index批量请求中的输入序号
model用于 embedding 的模型
usage.prompt_tokens返回时的输入 token 数
usage.total_tokens返回时的总 token 数

图像生成示例

图像生成请求字段

字段类型必填含义示例
model字符串图像模型 ID。如需完整提供方原生控制,请使用 媒体 APIkling-v3-omni
prompt字符串描述目标图像的文本提示词。A cinematic product poster...
size字符串所选路径支持时的输出尺寸。1024x1024
n整数支持时请求的图像数量。1
response_format字符串支持时的响应格式。url
user字符串客户侧终端用户标识。user_123
curl https://api.anyint.ai/openai/v1/images/generations \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-v3-omni",
    "prompt": "A cinematic product poster for an AI music launch."
  }'

更完整的提供方原生图像示例请看 图像生成媒体 API

音频请求字段

路由重要字段说明
POST /audio/speechmodel, input, voice, response_format, speed文本转语音。支持的声音和格式取决于所选模型。
POST /audio/transcriptionsfile, model, language, prompt, response_format, temperature客户端要求时使用 multipart 上传。
POST /audio/translationsfile, model, prompt, response_format, temperature将音频翻译为英文或提供方支持的目标行为。

文件、Assistant、Thread 和 Batch 字段

这些端点是透传兼容路由。仅当你的客户端已经依赖 OpenAI 兼容结构时使用,并针对所选模型路径验证支持情况。

领域常见字段客户指导
Filesfile, purpose, file_id仅在客户端需要 OpenAI 兼容 file 对象时使用。
Assistantsmodel, name, instructions, tools, file_ids新的简单应用优先使用 Chat Completions 或 Responses,除非客户端要求 Assistants。
Threadsmessages, metadata, thread_id适用于内置 thread 处理的 OpenAI 兼容客户端。
Runsassistant_id, model, instructions, tools, stream按模型验证工具和流式行为。
Batchesinput_file_id, endpoint, completion_window, metadata适用于已经生成兼容 batch 文件的客户端。

视频路由行为

OpenAI 风格视频请求可以发送到 /openai/v1/videos。使用 model 字段选择当前账号可用的视频模型 ID。可用模型 ID 通过 模型 API 查询;可选参数请查看对应模型专页。

Kling 专属示例见 Kling 视频。如果你的集成需要 model_nameimage_listvideo_list 等提供方原生字段,请使用对应模型专页中的提供方原生路由。

常见错误

  • 假设所有 OpenAI 上游功能都对每个 AnyInt 模型启用
  • 未查看路由页面,就把提供方原生媒体 payload 发送到 OpenAI 兼容端点
  • 新应用在 Chat Completions 或 Responses 足够时,过早使用 Assistants、Threads、Batches 或 Files

相关页面

On this page