omni-inference
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->
<!-- 由 src/lib/agentSkills/generator.ts 生成;手动修改将被覆盖 -->
Overview
概述
The core OpenAI-compatible inference endpoints: chat completions, embeddings, images, audio (TTS/STT), moderations, rerank, and the Responses API. The primary integration surface for AI agents.
兼容 OpenAI 的核心推理端点:聊天补全、嵌入、图像、音频(TTS/STT)、内容审核、重排序,以及 Responses API。是 AI Agent 的主要集成接口。
Authentication
身份验证
All requests require a valid Bearer token or session cookie. Obtain a token via or configure for local development.
POST /api/auth/loginREQUIRE_API_KEY=false所有请求都需要有效的 Bearer token 或 session cookie。可通过 获取 token,或在本地开发环境中配置 。
POST /api/auth/loginREQUIRE_API_KEY=falseEndpoints
端点
POST /api/v1/session-leasesGET /api/v1/searchPOST /api/v1/searchPOST /api/v1/chat/completionsGET /api/v1/wsPOST /api/v1/providers/{provider}/chat/completionsPOST /api/v1/api/chatPOST /api/v1/messagesPOST /api/v1/messages/count_tokensPOST /api/v1/responsesPOST /api/v1/embeddingsGET /api/v1/multimodal-embeddingsPOST /api/v1/multimodal-embeddingsPOST /api/v1/providers/{provider}/embeddingsPOST /api/v1/images/generationsPOST /api/v1/providers/{provider}/images/generationsPOST /api/v1/audio/speechPOST /api/v1/audio/transcriptionsPOST /api/v1/moderationsPOST /api/v1/rerankGET /api/v1GET /api/v1/providers/{provider}/modelsGET /api/v1/management/proxy-subscriptionsPOST /api/v1/management/proxy-subscriptionsGET /api/v1/management/proxy-subscriptions/{id}PATCH /api/v1/management/proxy-subscriptions/{id}DELETE /api/v1/management/proxy-subscriptions/{id}GET /api/v1/management/proxy-subscriptions/{id}/nodesPOST /api/v1/management/proxy-subscriptions/{id}/refreshPOST /api/v1/ocrPOST /api/v1/audio/translationsGET /api/v1/voicesPOST /api/v1/speech-to-textPOST /api/v1/text-to-speech/{voiceId}GET /api/v1/explain/routingGET /api/v1/providers/suggested-modelsGET /api/v1/provider-plugin-manifestGET /api/v1/{omnirouteCatchAll}POST /api/v1/{omnirouteCatchAll}PUT /api/v1/{omnirouteCatchAll}PATCH /api/v1/{omnirouteCatchAll}DELETE /api/v1/{omnirouteCatchAll}GET /api/v1/accounts/{id}/limitsPUT /api/v1/accounts/{id}/limitsGET /api/v1/agents/credentialsPOST /api/v1/agents/credentialsGET /api/v1/agents/healthGET /api/v1/agents/tasksPOST /api/v1/agents/tasksDELETE /api/v1/agents/tasksGET /api/v1/agents/tasks/{id}POST /api/v1/agents/tasks/{id}DELETE /api/v1/agents/tasks/{id}POST /api/v1/antigravityGET /api/v1/auto-combo/{channel}/candidatesGET /api/v1/batchesPOST /api/v1/batchesGET /api/v1/batches/{id}DELETE /api/v1/batches/{id}POST /api/v1/batches/{id}/cancelDELETE /api/v1/batches/delete-completedPOST /api/v1/classifyGET /api/v1/combosPOST /api/v1/completionsGET /api/v1/filesPOST /api/v1/filesGET /api/v1/files/{id}DELETE /api/v1/files/{id}GET /api/v1/files/{id}/contentPOST /api/v1/images/editsGET /api/v1/images/upscalePOST /api/v1/images/upscaleGET /api/v1/media/{id}POST /api/v1/issues/reportGET /api/v1/management/proxiesPOST /api/v1/management/proxiesPATCH /api/v1/management/proxiesDELETE /api/v1/management/proxiesGET /api/v1/management/proxies/assignmentsPUT /api/v1/management/proxies/assignmentsPUT /api/v1/management/proxies/bulk-assignGET /api/v1/management/proxies/healthGET /api/v1/me/statusGET /api/v1/muse-code/modelsGET /api/v1/music/generationsPOST /api/v1/music/generationsGET /api/v1/providers/{provider}/limitsPUT /api/v1/providers/{provider}/limitsGET /api/v1/quotas/checkGET /api/v1/registered-keysPOST /api/v1/registered-keysGET /api/v1/registered-keys/{id}DELETE /api/v1/registered-keys/{id}POST /api/v1/registered-keys/{id}/revokePOST /api/v1/relay/chat/completionsPOST /api/v1/relay/chat/completions/bifrostPOST /api/v1/responses/{path}GET /api/v1/search/analyticsPOST /api/v1/segmentGET /api/v1/video-bridge/drilldownDELETE /api/v1/video-bridge/drilldownGET /api/v1/videos/generationsPOST /api/v1/videos/generationsGET /api/v1/vscode/{token}POST /api/v1/vscode/{token}/api/chatPOST /api/v1/vscode/{token}/api/showGET /api/v1/vscode/{token}/api/tagsGET /api/v1/vscode/{token}/api/versionPOST /api/v1/vscode/{token}/chat/completionsGET /api/v1/vscode/{token}/combosGET /api/v1/vscode/{token}/modelsPOST /api/v1/vscode/{token}/responsesPOST /api/v1/vscode/{token}/v1/chat/completionsGET /api/v1/vscode/{token}/v1/modelsGET /api/v1/vscode/combos/{token}/{{slug}}POST /api/v1/vscode/combos/{token}/{{slug}}GET /api/v1/vscode/raw/{token}POST /api/v1/vscode/raw/{token}/api/chatPOST /api/v1/vscode/raw/{token}/api/showGET /api/v1/vscode/raw/{token}/api/tagsGET /api/v1/vscode/raw/{token}/api/versionPOST /api/v1/vscode/raw/{token}/chat/completionsGET /api/v1/vscode/raw/{token}/combosGET /api/v1/vscode/raw/{token}/modelsPOST /api/v1/vscode/raw/{token}/responsesPOST /api/v1/vscode/raw/{token}/v1/chat/completionsGET /api/v1/vscode/raw/{token}/v1/modelsPOST /api/v1/web/fetch
POST /api/v1/session-leasesGET /api/v1/searchPOST /api/v1/searchPOST /api/v1/chat/completionsGET /api/v1/wsPOST /api/v1/providers/{provider}/chat/completionsPOST /api/v1/api/chatPOST /api/v1/messagesPOST /api/v1/messages/count_tokensPOST /api/v1/responsesPOST /api/v1/embeddingsGET /api/v1/multimodal-embeddingsPOST /api/v1/multimodal-embeddingsPOST /api/v1/providers/{provider}/embeddingsPOST /api/v1/images/generationsPOST /api/v1/providers/{provider}/images/generationsPOST /api/v1/audio/speechPOST /api/v1/audio/transcriptionsPOST /api/v1/moderationsPOST /api/v1/rerankGET /api/v1GET /api/v1/providers/{provider}/modelsGET /api/v1/management/proxy-subscriptionsPOST /api/v1/management/proxy-subscriptionsGET /api/v1/management/proxy-subscriptions/{id}PATCH /api/v1/management/proxy-subscriptions/{id}DELETE /api/v1/management/proxy-subscriptions/{id}GET /api/v1/management/proxy-subscriptions/{id}/nodesPOST /api/v1/management/proxy-subscriptions/{id}/refreshPOST /api/v1/ocrPOST /api/v1/audio/translationsGET /api/v1/voicesPOST /api/v1/speech-to-textPOST /api/v1/text-to-speech/{voiceId}GET /api/v1/explain/routingGET /api/v1/providers/suggested-modelsGET /api/v1/provider-plugin-manifestGET /api/v1/{omnirouteCatchAll}POST /api/v1/{omnirouteCatchAll}PUT /api/v1/{omnirouteCatchAll}PATCH /api/v1/{omnirouteCatchAll}DELETE /api/v1/{omnirouteCatchAll}GET /api/v1/accounts/{id}/limitsPUT /api/v1/accounts/{id}/limitsGET /api/v1/agents/credentialsPOST /api/v1/agents/credentialsGET /api/v1/agents/healthGET /api/v1/agents/tasksPOST /api/v1/agents/tasksDELETE /api/v1/agents/tasksGET /api/v1/agents/tasks/{id}POST /api/v1/agents/tasks/{id}DELETE /api/v1/agents/tasks/{id}POST /api/v1/antigravityGET /api/v1/auto-combo/{channel}/candidatesGET /api/v1/batchesPOST /api/v1/batchesGET /api/v1/batches/{id}DELETE /api/v1/batches/{id}POST /api/v1/batches/{id}/cancelDELETE /api/v1/batches/delete-completedPOST /api/v1/classifyGET /api/v1/combosPOST /api/v1/completionsGET /api/v1/filesPOST /api/v1/filesGET /api/v1/files/{id}DELETE /api/v1/files/{id}GET /api/v1/files/{id}/contentPOST /api/v1/images/editsGET /api/v1/images/upscalePOST /api/v1/images/upscaleGET /api/v1/media/{id}POST /api/v1/issues/reportGET /api/v1/management/proxiesPOST /api/v1/management/proxiesPATCH /api/v1/management/proxiesDELETE /api/v1/management/proxiesGET /api/v1/management/proxies/assignmentsPUT /api/v1/management/proxies/assignmentsPUT /api/v1/management/proxies/bulk-assignGET /api/v1/management/proxies/healthGET /api/v1/me/statusGET /api/v1/muse-code/modelsGET /api/v1/music/generationsPOST /api/v1/music/generationsGET /api/v1/providers/{provider}/limitsPUT /api/v1/providers/{provider}/limitsGET /api/v1/quotas/checkGET /api/v1/registered-keysPOST /api/v1/registered-keysGET /api/v1/registered-keys/{id}DELETE /api/v1/registered-keys/{id}POST /api/v1/registered-keys/{id}/revokePOST /api/v1/relay/chat/completionsPOST /api/v1/relay/chat/completions/bifrostPOST /api/v1/responses/{path}GET /api/v1/search/analyticsPOST /api/v1/segmentGET /api/v1/video-bridge/drilldownDELETE /api/v1/video-bridge/drilldownGET /api/v1/videos/generationsPOST /api/v1/videos/generationsGET /api/v1/vscode/{token}POST /api/v1/vscode/{token}/api/chatPOST /api/v1/vscode/{token}/api/showGET /api/v1/vscode/{token}/api/tagsGET /api/v1/vscode/{token}/api/versionPOST /api/v1/vscode/{token}/chat/completionsGET /api/v1/vscode/{token}/combosGET /api/v1/vscode/{token}/modelsPOST /api/v1/vscode/{token}/responsesPOST /api/v1/vscode/{token}/v1/chat/completionsGET /api/v1/vscode/{token}/v1/modelsGET /api/v1/vscode/combos/{token}/{{slug}}POST /api/v1/vscode/combos/{token}/{{slug}}GET /api/v1/vscode/raw/{token}POST /api/v1/vscode/raw/{token}/api/chatPOST /api/v1/vscode/raw/{token}/api/showGET /api/v1/vscode/raw/{token}/api/tagsGET /api/v1/vscode/raw/{token}/api/versionPOST /api/v1/vscode/raw/{token}/chat/completionsGET /api/v1/vscode/raw/{token}/combosGET /api/v1/vscode/raw/{token}/modelsPOST /api/v1/vscode/raw/{token}/responsesPOST /api/v1/vscode/raw/{token}/v1/chat/completionsGET /api/v1/vscode/raw/{token}/v1/modelsPOST /api/v1/web/fetch
Payloads
载荷
See the full OpenAPI specification at or for detailed request/response schemas.
<!-- skill:custom-start -->
<!-- Aggregated from: omniroute-chat, omniroute-image, omniroute-tts, omniroute-stt, omniroute-embeddings, omniroute-web-search, omniroute-web-fetch -->GET /api/openapi/specdocs/openapi.yaml有关详细的请求/响应 schema,请参阅 或 中的完整 OpenAPI 规范。
<!-- skill:custom-start -->
<!-- 聚合自:omniroute-chat, omniroute-image, omniroute-tts, omniroute-stt, omniroute-embeddings, omniroute-web-search, omniroute-web-fetch -->GET /api/openapi/specdocs/openapi.yamlChat completions
聊天补全
Endpoints
端点
- — OpenAI format
POST $OMNIROUTE_URL/v1/chat/completions - — Anthropic Messages format
POST $OMNIROUTE_URL/v1/messages - — OpenAI Responses API
POST $OMNIROUTE_URL/v1/responses
- — OpenAI 格式
POST $OMNIROUTE_URL/v1/chat/completions - — Anthropic Messages 格式
POST $OMNIROUTE_URL/v1/messages - — OpenAI Responses API
POST $OMNIROUTE_URL/v1/responses
Discover
模型发现
bash
curl $OMNIROUTE_URL/v1/models | jq '.data[].id'Combos (e.g. , , ) auto-fallback through multiple providers.
autocost-optimizedsubscriptionbash
curl $OMNIROUTE_URL/v1/models | jq '.data[].id'Combos(例如 、、)可在多个 provider 之间自动回退。
autocost-optimizedsubscriptionOpenAI format example
OpenAI 格式示例
bash
curl -X POST $OMNIROUTE_URL/v1/chat/completions \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-7",
"messages": [{"role": "user", "content": "Refactor this function"}],
"stream": true
}'bash
curl -X POST $OMNIROUTE_URL/v1/chat/completions \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-7",
"messages": [{"role": "user", "content": "Refactor this function"}],
"stream": true
}'Anthropic format example
Anthropic 格式示例
bash
curl -X POST $OMNIROUTE_URL/v1/messages \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-7",
"max_tokens": 4096,
"messages": [{"role": "user", "content": "Hi"}]
}'bash
curl -X POST $OMNIROUTE_URL/v1/messages \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-7",
"max_tokens": 4096,
"messages": [{"role": "user", "content": "Hi"}]
}'Tool use
工具使用
Supports OpenAI array and Anthropic block. Tool results
auto-compressed via RTK (47 filters: git-diff, grep, test-jest, terraform-plan,
docker-logs, etc.) — 20-40% token savings. Disable per-request with
header.
toolstoolsX-Omniroute-Rtk: off支持 OpenAI 数组和 Anthropic 块。工具结果可通过 RTK 自动压缩(47 个过滤器:git-diff、grep、test-jest、terraform-plan、docker-logs 等)——节省 20–40% token。可通过 请求头按请求禁用。
toolstoolsX-Omniroute-Rtk: offReasoning / thinking
推理 / 思考
Anthropic extended thinking and OpenAI Responses reasoning blocks are forwarded
verbatim. Cached automatically via reasoning cache.
Anthropic 扩展思考和 OpenAI Responses 推理块将原样转发,并通过 reasoning cache 自动缓存。
Errors
错误
- → invalid API key
401 - → model not in registry; check
400 invalid_model/v1/models - → provider circuit breaker tripped; retry later or use combo
503 circuit_open - → honor
429 rate_limited; consider using a combo for auto-fallbackRetry-After
- → API 密钥无效
401 - → 模型不在注册表中;请检查
400 invalid_model/v1/models - → provider 熔断器已触发;请稍后重试或使用 combo
503 circuit_open - → 请遵循
429 rate_limited;可考虑使用 combo 进行自动回退Retry-After
Image generation
图像生成
Endpoints
端点
- — Text-to-image
POST $OMNIROUTE_URL/v1/images/generations - — Image edit (mask)
POST $OMNIROUTE_URL/v1/images/edits - — Variations
POST $OMNIROUTE_URL/v1/images/variations
- — 文生图
POST $OMNIROUTE_URL/v1/images/generations - — 图像编辑(蒙版)
POST $OMNIROUTE_URL/v1/images/edits - — 图像变体
POST $OMNIROUTE_URL/v1/images/variations
Discover
模型发现
bash
curl $OMNIROUTE_URL/v1/models/image | jq '.data[]'Returns per model.
{ id, owned_by, sizes:[...], capabilities:[...] }bash
curl $OMNIROUTE_URL/v1/models/image | jq '.data[]'每个模型返回 。
{ id, owned_by, sizes:[...], capabilities:[...] }Generate example
生成示例
bash
curl -X POST $OMNIROUTE_URL/v1/images/generations \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "a red bicycle on a wet street, photoreal",
"n": 1,
"size": "1024x1024",
"response_format": "b64_json"
}'Response:
{ created, data: [{ url? or b64_json, revised_prompt }] }bash
curl -X POST $OMNIROUTE_URL/v1/images/generations \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "a red bicycle on a wet street, photoreal",
"n": 1,
"size": "1024x1024",
"response_format": "b64_json"
}'响应:
{ created, data: [{ url? or b64_json, revised_prompt }] }Errors
错误
- → not supported by this model; check
400 invalid_size/v1/models/image - → blocked by provider safety
400 content_policy_violation - → provider unavailable; try another model in
503/v1/models/image
- → 此模型不支持该尺寸;请检查
400 invalid_size/v1/models/image - → 被 provider 安全策略阻止
400 content_policy_violation - → provider 不可用;请尝试使用
503中的其他模型/v1/models/image
Text-to-speech
文本转语音
Endpoint
端点
- — returns binary audio (mp3/opus/wav/flac)
POST $OMNIROUTE_URL/v1/audio/speech
- — 返回二进制音频(mp3/opus/wav/flac)
POST $OMNIROUTE_URL/v1/audio/speech
Discover
模型发现
bash
curl $OMNIROUTE_URL/v1/models/tts | jq '.data[]'Each entry includes for the available voice names per provider.
voices:[...]bash
curl $OMNIROUTE_URL/v1/models/tts | jq '.data[]'每个条目都包含 ,用于列出各 provider 可用的 voice 名称。
voices:[...]Example
示例
bash
curl -X POST $OMNIROUTE_URL/v1/audio/speech \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "Hello from OmniRoute.",
"voice": "alloy",
"response_format": "mp3"
}' --output speech.mp3bash
curl -X POST $OMNIROUTE_URL/v1/audio/speech \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "Hello from OmniRoute.",
"voice": "alloy",
"response_format": "mp3"
}' --output speech.mp3Voices
Voice
Voice names vary by provider. Check — each entry has .
Common OpenAI voices: , , , , , .
/v1/models/ttsvoices:[...]alloyechofableonyxnovashimmerVoice 名称因 provider 而异。请检查 ——每个条目都包含 。
常见的 OpenAI voice:、、、、、。
/v1/models/ttsvoices:[...]alloyechofableonyxnovashimmerErrors
错误
- → voice not supported by this model
400 invalid_voice - → input exceeds model character limit
400 input_too_long - → provider unavailable; try another model in
503/v1/models/tts
- → 此模型不支持该 voice
400 invalid_voice - → 输入超过模型的字符数限制
400 input_too_long - → provider 不可用;请尝试使用
503中的其他模型/v1/models/tts
Speech-to-text
语音转文本
Endpoints
端点
- — multipart upload, returns text
POST $OMNIROUTE_URL/v1/audio/transcriptions - — transcribe + translate to English
POST $OMNIROUTE_URL/v1/audio/translations
- — multipart 上传,返回文本
POST $OMNIROUTE_URL/v1/audio/transcriptions - — 转录并翻译成英文
POST $OMNIROUTE_URL/v1/audio/translations
Discover
模型发现
bash
curl $OMNIROUTE_URL/v1/models/stt | jq '.data[]'bash
curl $OMNIROUTE_URL/v1/models/stt | jq '.data[]'Example
示例
bash
curl -X POST $OMNIROUTE_URL/v1/audio/transcriptions \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-F "file=@audio.mp3" \
-F "model=whisper-1" \
-F "response_format=verbose_json"Response:
{ text, language, duration, segments?:[{ start, end, text }] }bash
curl -X POST $OMNIROUTE_URL/v1/audio/transcriptions \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-F "file=@audio.mp3" \
-F "model=whisper-1" \
-F "response_format=verbose_json"响应:
{ text, language, duration, segments?:[{ start, end, text }] }Supported formats
支持的格式
Audio: , , , , , , .
Response formats: , , , , .
mp3mp4mpegmpgam4awavwebmjsontextsrtverbose_jsonvtt音频格式:、、、、、、。
响应格式:、、、、。
mp3mp4mpegmpgam4awavwebmjsontextsrtverbose_jsonvttErrors
错误
- → unsupported audio format
400 invalid_file_format - → exceeds provider limit (usually 25MB)
400 file_too_large - → provider unavailable; try another model in
503/v1/models/stt
- → 不支持的音频格式
400 invalid_file_format - → 超过 provider 限制(通常为 25MB)
400 file_too_large - → provider 不可用;请尝试使用
503中的其他模型/v1/models/stt
Embeddings
嵌入
Endpoint
端点
POST $OMNIROUTE_URL/v1/embeddings
POST $OMNIROUTE_URL/v1/embeddings
Discover
模型发现
bash
curl $OMNIROUTE_URL/v1/models/embedding | jq '.data[]'Each entry: .
{ id, owned_by, dimensions, max_input_tokens }bash
curl $OMNIROUTE_URL/v1/models/embedding | jq '.data[]'每个条目:。
{ id, owned_by, dimensions, max_input_tokens }Example
示例
bash
curl -X POST $OMNIROUTE_URL/v1/embeddings \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-large",
"input": ["first text", "second text"],
"encoding_format": "float"
}'Response:
{ data:[{ embedding:[...], index }], usage:{ prompt_tokens, total_tokens } }bash
curl -X POST $OMNIROUTE_URL/v1/embeddings \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-large",
"input": ["first text", "second text"],
"encoding_format": "float"
}'响应:
{ data:[{ embedding:[...], index }], usage:{ prompt_tokens, total_tokens } }Batch input
批量输入
inputinputErrors
错误
- → input exceeds
400 input_too_longfor this modelmax_input_tokens - → use
400 invalid_encoding_formatorfloatbase64 - → provider unavailable; try another model in
503/v1/models/embedding
- → 输入超过此模型的
400 input_too_longmax_input_tokens - → 请使用
400 invalid_encoding_format或floatbase64 - → provider 不可用;请尝试使用
503中的其他模型/v1/models/embedding
Web search
网页搜索
Endpoint
端点
- — unified search format
POST $OMNIROUTE_URL/v1/web/search
- — 统一搜索格式
POST $OMNIROUTE_URL/v1/web/search
Discover
模型发现
bash
curl $OMNIROUTE_URL/v1/models/web | jq '.data[] | select(.kind == "webSearch")'bash
curl $OMNIROUTE_URL/v1/models/web | jq '.data[] | select(.kind == "webSearch")'Example
示例
bash
curl -X POST $OMNIROUTE_URL/v1/web/search \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tavily/search",
"query": "OmniRoute github latest release",
"max_results": 5,
"include_answer": true
}'Response:
{ answer?, results:[{ url, title, content, score }] }bash
curl -X POST $OMNIROUTE_URL/v1/web/search \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tavily/search",
"query": "OmniRoute github latest release",
"max_results": 5,
"include_answer": true
}'响应:
{ answer?, results:[{ url, title, content, score }] }Parameters
参数
| Field | Type | Description |
|---|---|---|
| string | Provider model from |
| string | Search query |
| number | Max results (default: 5) |
| boolean | Include AI-synthesized answer |
| string | |
| 字段 | 类型 | 说明 |
|---|---|---|
| string | 来自 |
| string | 搜索查询 |
| number | 最大结果数(默认值:5) |
| boolean | 包含 AI 合成答案 |
| string | |
Errors
错误
- → shorten the search query
400 query_too_long - → provider unavailable; try another model in
503/v1/models/web
- → 请缩短搜索查询
400 query_too_long - → provider 不可用;请尝试使用
503中的其他模型/v1/models/web
Web fetch
网页内容抓取
Endpoint
端点
POST $OMNIROUTE_URL/v1/web/fetch
POST $OMNIROUTE_URL/v1/web/fetch
Discover
模型发现
bash
curl $OMNIROUTE_URL/v1/models/web | jq '.data[] | select(.kind == "webFetch")'bash
curl $OMNIROUTE_URL/v1/models/web | jq '.data[] | select(.kind == "webFetch")'Example
示例
bash
curl -X POST $OMNIROUTE_URL/v1/web/fetch \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jina/reader",
"url": "https://anthropic.com",
"format": "markdown"
}'Response:
{ url, title, markdown, links?:[...], images?:[...] }bash
curl -X POST $OMNIROUTE_URL/v1/web/fetch \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jina/reader",
"url": "https://anthropic.com",
"format": "markdown"
}'响应:
{ url, title, markdown, links?:[...], images?:[...] }Parameters
参数
| Field | Type | Description |
|---|---|---|
| string | Provider from |
| string | URL to fetch |
| string | |
| 字段 | 类型 | 说明 |
|---|---|---|
| string | 来自 |
| string | 要抓取的 URL |
| string | |
Errors
错误
- → URL must be http/https
400 invalid_url - → provider blocked by target site; try a different model
403 blocked - → provider unavailable; try another model in
503/v1/models/web
- → URL 必须使用 http/https
400 invalid_url - → 目标网站阻止了该 provider;请尝试使用其他模型
403 blocked - → provider 不可用;请尝试使用
503中的其他模型/v1/models/web