Tham chiếu API
Sử dụng một cổng và khóa API trên các quy trình làm việc phương tiện không đồng bộ, OpenAI-compatible, Anthropic và Gemini.
- Server
https://api.anyint.aiNguồn AnyInt Gateway phục vụ tài liệu OpenAPI này.
80 điểm cuối
Tích hợp ChatRoom
4 điểm cuốiDiscover key-scoped models and enterprise capabilities for independent ChatRoom clients.
Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/tasks/request-costs' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"request_ids": [
"req_example:async"
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"request_ids": [
"req_example:async"
]
}Các phản hồi
{
"request_costs": [
{
"request_id": "req_example:async",
"credits": 125
}
]
}Native ChatRoom metadata authenticated with a Developer API key. Preserves existing tenant/key visibility and imported stable asset ownership references.
GET /v1/chatroom/modelsVí dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/chatroom/models?scope=<scope>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| scope | query | string | Bắt buộc | — |
| limit | query | integer | Tùy chọn | —Ví dụ: 1000 |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"success": true,
"data": {
"models": [],
"total": 0
}
}Native ChatRoom metadata authenticated with a Developer API key. Preserves existing tenant/key visibility and imported stable asset ownership references.
GET /v1/chatroom/enterprise-contextVí dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/chatroom/enterprise-context' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"success": true,
"data": {
"featureControls": {
"seedanceAuthorizedAssets": false,
"videoDramaUsage": {
"enabled": false,
"dramaNames": []
}
}
}
}Native ChatRoom metadata authenticated with a Developer API key. Preserves existing tenant/key visibility and imported stable asset ownership references.
GET /v1/chatroom/key-contextVí dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/chatroom/key-context' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"success": true,
"data": {
"userId": "user_example",
"apiKeyId": "key_example",
"featureControls": {
"seedanceAuthorizedAssets": false,
"videoDramaUsage": {
"enabled": false,
"dramaNames": []
}
}
}
}Trò chuyện
2 điểm cuốiTạo các phản hồi hội thoại tương thích với OpenAI.
When routed through a Gemini adapter, usage includes gemini_usage_metadata with the original token counters for precise modality and cache billing. OpenAI output totals include Gemini thinking tokens; detailed native counters are preserved in Chat Completions, its SSE usage frames, and supported Responses conversions. Embedded Portkey Anthropic Chat and directed Responses-to-Anthropic conversions expose inclusive OpenAI input totals and anthropic_usage_metadata with the original ordinary input, cache-read, cache-write and 5m/1h cache-write counters in JSON and SSE for precise billing. Gemini Chat Completions streams emit a terminal choice with finish_reason before data: [DONE]: STOP maps to stop and MAX_TOKENS maps to length. An upstream EOF without a finish reason does not synthesize successful completion. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Invalid request envelopes, missing model/messages and stream values other than boolean or null return HTTP 400 before funding or provider dispatch. A null stream selects non-streaming without rewriting the native request body. Directed Chat conversions to Gemini or Anthropic preserve the smaller positive max_tokens/max_completion_tokens bound. Stop sequences are mapped between the supported Chat protocols; target-model parameter restrictions still apply. Directed Chat SSE uses one created timestamp for all chunks and emits a public usage-only chunk only when stream_options.include_usage is true. Without that option, usage is also removed from mixed content/finish chunks while retaining choices, terminal reasons and error events. Internal usage collection and settlement are independent of this public option. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /v1/chat/completionsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/chat/completions' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Explain edge computing in 2 sentences."
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Explain edge computing in 2 sentences."
}
]
}Các phản hồi
{
"id": "chatcmpl_example",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Edge computing processes data near its source, reducing latency and bandwidth use."
},
"finish_reason": "stop"
}
]
}When routed through a Gemini adapter, usage includes gemini_usage_metadata with the original token counters for precise modality and cache billing. OpenAI output totals include Gemini thinking tokens; detailed native counters are preserved in Chat Completions, its SSE usage frames, and supported Responses conversions. Embedded Portkey Anthropic Chat and directed Responses-to-Anthropic conversions expose inclusive OpenAI input totals and anthropic_usage_metadata with the original ordinary input, cache-read, cache-write and 5m/1h cache-write counters in JSON and SSE for precise billing. Gemini Chat Completions streams emit a terminal choice with finish_reason before data: [DONE]: STOP maps to stop and MAX_TOKENS maps to length. An upstream EOF without a finish reason does not synthesize successful completion. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Invalid request envelopes, missing model/messages and stream values other than boolean or null return HTTP 400 before funding or provider dispatch. A null stream selects non-streaming without rewriting the native request body. Directed Chat conversions to Gemini or Anthropic preserve the smaller positive max_tokens/max_completion_tokens bound. Stop sequences are mapped between the supported Chat protocols; target-model parameter restrictions still apply. Directed Chat SSE uses one created timestamp for all chunks and emits a public usage-only chunk only when stream_options.include_usage is true. Without that option, usage is also removed from mixed content/finish chunks while retaining choices, terminal reasons and error events. Internal usage collection and settlement are independent of this public option. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /openai/v1/chat/completionsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/chat/completions' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Explain edge computing in 2 sentences."
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Explain edge computing in 2 sentences."
}
]
}Các phản hồi
{
"id": "chatcmpl_example",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Edge computing processes data near its source, reducing latency and bandwidth use."
},
"finish_reason": "stop"
}
]
}Phản hồi
2 điểm cuốiTạo phản hồi với định dạng API Phản hồi của OpenAI.
When routed through a Gemini adapter, usage includes gemini_usage_metadata with the original token counters for precise modality and cache billing. OpenAI output totals include Gemini thinking tokens; detailed native counters are preserved in Chat Completions, its SSE usage frames, and supported Responses conversions. Embedded Portkey Anthropic Chat and directed Responses-to-Anthropic conversions expose inclusive OpenAI input totals and anthropic_usage_metadata with the original ordinary input, cache-read, cache-write and 5m/1h cache-write counters in JSON and SSE for precise billing. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Native Responses accepts stream:null as non-streaming while retaining null in the native request body. Invalid non-boolean, non-null stream values return HTTP 400 before funding or dispatch. Native Responses preserves custom tool calls, multi-part tool outputs, assistant phase and Unicode text. Missing/null output_text annotations and logprobs become empty arrays before funding and dispatch; provider keep-alive messages are excluded from history. reasoning.effort is forwarded without downgrade: a structured unsupported-value rejection returns HTTP 400 invalid_value with error.param=reasoning.effort and a server-owned message. A provider-generated or unlocatable 400 becomes HTTP 502 upstream_error; transient rejected work is retryable unless the execution outcome is unconfirmed. Directed Responses conversions keep one created_at for response.created and terminal events. Responses-to-Chat validates the actual target conversion before funding, including unsupported history/state inputs. Streaming filters response.metadata, codex.response.metadata, responsesapi.websocket_timing, and SSE-Keep-Alive control items, uses SSE comments for heartbeats, and emits monotonic sequence_number values. Heartbeat names are case-insensitive and accept keepalive, keep-alive and keep_alive variants; they become SSE comments without terminating valid output or changing usage. Repeated SSE event fields use the last field value, including an empty reset. Explicit error/response.failed SSE event headers and error payloads, including nested response.error or response.status=failed, take precedence over heartbeat, diagnostic metadata and keep-alive item markers. Failure event names and failure type markers are recognized case-insensitively without rewriting successful lifecycle types. They emit one sanitized response.failed and suppress subsequent successful completion while preserving the original bytes for settlement. Successful terminal events are delivered only after mandatory stream settlement succeeds: response.completed for success or response.incomplete for a provider token limit. A mandatory settlement failure emits response.failed, retains the already-sent HTTP status, and records a failed final inference outcome. Early EOF, timeout or provider failure ends with response.failed, never a synthesized successful completion or legacy [DONE]. Stream failures are non-retryable because replay can duplicate dispatched work. Optional x-client-message-id/x-resume-message-id headers enable the existing event-offset recovery extension; clients without those headers do not need it.
POST /v1/responsesVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/responses' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"input": "Write a short welcome message."
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"input": "Write a short welcome message."
}Các phản hồi
{
"id": "resp_example",
"object": "response",
"status": "completed"
}When routed through a Gemini adapter, usage includes gemini_usage_metadata with the original token counters for precise modality and cache billing. OpenAI output totals include Gemini thinking tokens; detailed native counters are preserved in Chat Completions, its SSE usage frames, and supported Responses conversions. Embedded Portkey Anthropic Chat and directed Responses-to-Anthropic conversions expose inclusive OpenAI input totals and anthropic_usage_metadata with the original ordinary input, cache-read, cache-write and 5m/1h cache-write counters in JSON and SSE for precise billing. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Native Responses accepts stream:null as non-streaming while retaining null in the native request body. Invalid non-boolean, non-null stream values return HTTP 400 before funding or dispatch. Native Responses preserves custom tool calls, multi-part tool outputs, assistant phase and Unicode text. Missing/null output_text annotations and logprobs become empty arrays before funding and dispatch; provider keep-alive messages are excluded from history. reasoning.effort is forwarded without downgrade: a structured unsupported-value rejection returns HTTP 400 invalid_value with error.param=reasoning.effort and a server-owned message. A provider-generated or unlocatable 400 becomes HTTP 502 upstream_error; transient rejected work is retryable unless the execution outcome is unconfirmed. Directed Responses conversions keep one created_at for response.created and terminal events. Responses-to-Chat validates the actual target conversion before funding, including unsupported history/state inputs. Streaming filters response.metadata, codex.response.metadata, responsesapi.websocket_timing, and SSE-Keep-Alive control items, uses SSE comments for heartbeats, and emits monotonic sequence_number values. Heartbeat names are case-insensitive and accept keepalive, keep-alive and keep_alive variants; they become SSE comments without terminating valid output or changing usage. Repeated SSE event fields use the last field value, including an empty reset. Explicit error/response.failed SSE event headers and error payloads, including nested response.error or response.status=failed, take precedence over heartbeat, diagnostic metadata and keep-alive item markers. Failure event names and failure type markers are recognized case-insensitively without rewriting successful lifecycle types. They emit one sanitized response.failed and suppress subsequent successful completion while preserving the original bytes for settlement. Successful terminal events are delivered only after mandatory stream settlement succeeds: response.completed for success or response.incomplete for a provider token limit. A mandatory settlement failure emits response.failed, retains the already-sent HTTP status, and records a failed final inference outcome. Early EOF, timeout or provider failure ends with response.failed, never a synthesized successful completion or legacy [DONE]. Stream failures are non-retryable because replay can duplicate dispatched work. Optional x-client-message-id/x-resume-message-id headers enable the existing event-offset recovery extension; clients without those headers do not need it.
POST /openai/v1/responsesVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/responses' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"input": "Write a short welcome message."
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"input": "Write a short welcome message."
}Các phản hồi
{
"id": "resp_example",
"object": "response",
"status": "completed"
}Hoàn thành văn bản
2 điểm cuốiTạo các hoàn thành văn bản cũ tương thích với OpenAI.
OpenAI legacy Completions accepts boolean or null stream. Null selects non-streaming and remains null in the native provider request; other non-boolean values return HTTP 400 before funding or provider dispatch.
POST /v1/completionsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/completions' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Once upon a time"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Once upon a time"
}Các phản hồi
{
"id": "cmpl_example",
"object": "text_completion",
"choices": [
{
"index": 0,
"text": " there was a quiet coast."
}
]
}OpenAI legacy Completions accepts boolean or null stream. Null selects non-streaming and remains null in the native provider request; other non-boolean values return HTTP 400 before funding or provider dispatch.
POST /openai/v1/completionsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/completions' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Once upon a time"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Once upon a time"
}Các phản hồi
{
"id": "cmpl_example",
"object": "text_completion",
"choices": [
{
"index": 0,
"text": " there was a quiet coast."
}
]
}Embeddings
2 điểm cuốiTạo vector embeddings từ đầu vào văn bản.
Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/embeddings' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"input": "A calm ocean at dawn"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"input": "A calm ocean at dawn"
}Các phản hồi
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.012,
-0.008,
0.021
]
}
]
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/embeddings' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"input": "A calm ocean at dawn"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"input": "A calm ocean at dawn"
}Các phản hồi
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.012,
-0.008,
0.021
]
}
]
}Kiểm duyệt
2 điểm cuốiPhân loại văn bản hoặc hình ảnh có khả năng gây hại.
Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/moderations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"input": "Text to classify"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"input": "Text to classify"
}Các phản hồi
{
"id": "modr_example",
"model": "your-model-id",
"results": [
{
"flagged": false,
"categories": {},
"category_scores": {}
}
]
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/moderations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"input": "Text to classify"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"input": "Text to classify"
}Các phản hồi
{
"id": "modr_example",
"model": "your-model-id",
"results": [
{
"flagged": false,
"categories": {},
"category_scores": {}
}
]
}Lô
8 điểm cuốiGửi các lô JSONL gốc của nhà cung cấp khi bộ nhớ đối tượng được bật cho bản triển khai.
Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/batches' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| after | query | string | Tùy chọn | — |
| limit | query | integer | Tùy chọn | —Ví dụ: 20 |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "list",
"data": [
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}
],
"first_id": "batch_example",
"last_id": "batch_example",
"has_more": false
}Native prepaid batches validate the stored file checksum and strict JSONL before funding. Every item needs a server-owned execution policy for its pinned route and price, including file-upload and batch-create transport bounds. All item reservations commit atomically before provider submission; insufficient aggregate funds return HTTP 402 without submitting a partial batch. Incompatible provider configurations must be split into separate batches. Each submission permits one file upload and one batch create; an ambiguous submission returns batch_submission_recovery_required and retains funding without automatic resubmission. Failed, cancelled or missing item results do not prove zero provider cost and retain funding for reconciliation.
POST /v1/batchesVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/batches' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"input_file_id": "file_example",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Nội dung yêu cầu
Bắt buộc{
"input_file_id": "file_example",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}Các phản hồi
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/batches' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| after | query | string | Tùy chọn | — |
| limit | query | integer | Tùy chọn | —Ví dụ: 20 |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "list",
"data": [
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}
],
"first_id": "batch_example",
"last_id": "batch_example",
"has_more": false
}Native prepaid batches validate the stored file checksum and strict JSONL before funding. Every item needs a server-owned execution policy for its pinned route and price, including file-upload and batch-create transport bounds. All item reservations commit atomically before provider submission; insufficient aggregate funds return HTTP 402 without submitting a partial batch. Incompatible provider configurations must be split into separate batches. Each submission permits one file upload and one batch create; an ambiguous submission returns batch_submission_recovery_required and retains funding without automatic resubmission. Failed, cancelled or missing item results do not prove zero provider cost and retain funding for reconciliation.
POST /openai/v1/batchesVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/batches' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"input_file_id": "file_example",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Nội dung yêu cầu
Bắt buộc{
"input_file_id": "file_example",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}Các phản hồi
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/batches/<batch_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| batch_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/batches/<batch_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| batch_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/batches/<batch_id>/cancel' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| batch_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/batches/<batch_id>/cancel' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| batch_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "batch_example",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_example",
"completion_window": "24h",
"status": "in_progress",
"created_at": 1700000000,
"request_counts": {
"total": 100,
"completed": 0,
"failed": 0
}
}Tệp
5 điểm cuốiTải lên, liệt kê, kiểm tra và tải xuống các tệp.
Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/files' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "list",
"data": [
{
"id": "file_example",
"object": "file",
"bytes": 128,
"created_at": 1700000000,
"filename": "document.jsonl",
"purpose": "batch",
"status": "processed"
}
]
}Áp dụng chính sách IP và số yêu cầu mỗi phút của API key trước khi lưu nội dung. Việc tải lên không phụ thuộc mô hình và không tiêu tốn hạn mức suy luận. Tệp hết hạn sau 30 ngày kể từ khi tải lên, trừ khi expires_after đặt thời hạn ngắn hơn (từ 1 giờ đến 30 ngày); tệp hết hạn không còn được liệt kê hay tải xuống và sẽ bị xóa. Mỗi tenant có thể giữ tối đa 10.000 tệp đang hoạt động với tổng dung lượng 10 GiB.
POST /openai/v1/filesVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/files' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--form 'file=@path/to/document.jsonl' \
--form 'purpose=batch'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"file": "document.jsonl",
"purpose": "batch"
}Các phản hồi
{
"id": "file_example",
"object": "file",
"bytes": 128,
"created_at": 1700000000,
"filename": "document.jsonl",
"purpose": "batch",
"status": "processed"
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/files/<file_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| file_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "file_example",
"object": "file",
"bytes": 128,
"created_at": 1700000000,
"filename": "document.jsonl",
"purpose": "batch",
"status": "processed"
}Ví dụ yêu cầu
curl \
--request DELETE \
--url 'https://api.anyint.ai/openai/v1/files/<file_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| file_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "file_example",
"object": "file",
"deleted": true
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/files/<file_id>/content' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/octet-stream'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| file_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
<binary>Âm thanh
3 điểm cuốiPhiên âm âm thanh, dịch âm thanh sang tiếng Anh hoặc tổng hợp giọng nói.
Native prepaid organizations reserve the greater of customer and provider maximum costs before audio provider dispatch. A missing or mismatched server-owned execution bound returns non-retryable HTTP 503 prepaid_execution_bound_unavailable. Multipart bounds include file sizes and content hashes. Insufficient funds return HTTP 402. Successful responses require the configured billable usage; missing required usage returns HTTP 502 and retains funding. Provider errors or unknown outcomes retain funding for audited recovery. Personal and postpaid audio behavior is preserved.
POST /openai/v1/audio/transcriptionsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/audio/transcriptions' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--form 'file=@path/to/audio.wav' \
--form 'model=your-model-id'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"file": "audio.wav",
"model": "your-model-id"
}Các phản hồi
{
"text": "Example transcript."
}Native prepaid organizations reserve the greater of customer and provider maximum costs before audio provider dispatch. A missing or mismatched server-owned execution bound returns non-retryable HTTP 503 prepaid_execution_bound_unavailable. Multipart bounds include file sizes and content hashes. Insufficient funds return HTTP 402. Successful responses require the configured billable usage; missing required usage returns HTTP 502 and retains funding. Provider errors or unknown outcomes retain funding for audited recovery. Personal and postpaid audio behavior is preserved.
POST /openai/v1/audio/translationsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/audio/translations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--form 'file=@path/to/audio.wav' \
--form 'model=your-model-id'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"file": "audio.wav",
"model": "your-model-id"
}Các phản hồi
{
"text": "Example transcript."
}Native prepaid organizations reserve the greater of customer and provider maximum costs before audio provider dispatch. A missing or mismatched server-owned execution bound returns non-retryable HTTP 503 prepaid_execution_bound_unavailable. Multipart bounds include file sizes and content hashes. Insufficient funds return HTTP 402. Successful responses require the configured billable usage; missing required usage returns HTTP 502 and retains funding. Provider errors or unknown outcomes retain funding for audited recovery. Personal and postpaid audio behavior is preserved.
POST /openai/v1/audio/speechVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/audio/speech' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: audio/mpeg' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"voice": "your-voice-id",
"input": "Welcome to AnyInt Gateway."
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"voice": "your-voice-id",
"input": "Welcome to AnyInt Gateway."
}Các phản hồi
<binary>Hình ảnh
4 điểm cuốiGenerate and edit images with OpenAI-compatible requests.
Accepts multipart uploaded images or nonstreaming JSON URL inputs. JSON requires model, prompt and 1-16 images with image_url; mask may contain one image_url. URL inputs use the selected upstream's native JSON Images API, so that channel must support URL edits. Model permissions, enterprise channel selection, funding and settlement apply to both inputs. URLs must use public HTTPS without embedded credentials; the gateway does not download them. Other native JSON parameters are preserved. gpt-image-2 defaults quality to medium. Malformed URL inputs, missing images, unsupported streaming, invalid image count and invalid quality return HTTP 400 before funding or provider dispatch.
POST /v1/images/editsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/images/edits' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Combine these reference images on a soft blue background.",
"images": [
{
"image_url": "https://cdn.example.com/reference-1.png"
},
{
"image_url": "https://cdn.example.com/reference-2.png"
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Combine these reference images on a soft blue background.",
"images": [
{
"image_url": "https://cdn.example.com/reference-1.png"
},
{
"image_url": "https://cdn.example.com/reference-2.png"
}
]
}Các phản hồi
{
"created": 1700000000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
}
]
}Accepts multipart uploaded images or nonstreaming JSON URL inputs. JSON requires model, prompt and 1-16 images with image_url; mask may contain one image_url. URL inputs use the selected upstream's native JSON Images API, so that channel must support URL edits. Model permissions, enterprise channel selection, funding and settlement apply to both inputs. URLs must use public HTTPS without embedded credentials; the gateway does not download them. Other native JSON parameters are preserved. gpt-image-2 defaults quality to medium. Malformed URL inputs, missing images, unsupported streaming, invalid image count and invalid quality return HTTP 400 before funding or provider dispatch.
POST /openai/v1/images/editsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/images/edits' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Combine these reference images on a soft blue background.",
"images": [
{
"image_url": "https://cdn.example.com/reference-1.png"
},
{
"image_url": "https://cdn.example.com/reference-2.png"
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Combine these reference images on a soft blue background.",
"images": [
{
"image_url": "https://cdn.example.com/reference-1.png"
},
{
"image_url": "https://cdn.example.com/reference-2.png"
}
]
}Các phản hồi
{
"created": 1700000000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
}
]
}Accepts multipart uploaded images or nonstreaming JSON URL inputs. JSON requires model, prompt and 1-16 images with image_url; mask may contain one image_url. URL inputs use the selected upstream's native JSON Images API, so that channel must support URL edits. Model permissions, enterprise channel selection, funding and settlement apply to both inputs. URLs must use public HTTPS without embedded credentials; the gateway does not download them. Other native JSON parameters are preserved. gpt-image-2 defaults quality to medium. Malformed URL inputs, missing images, unsupported streaming, invalid image count and invalid quality return HTTP 400 before funding or provider dispatch.
POST /v1/images/generationsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/images/generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "A minimal paper sculpture of a cloud",
"n": 1
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "A minimal paper sculpture of a cloud",
"n": 1
}Các phản hồi
{
"created": 1700000000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
}
]
}Accepts multipart uploaded images or nonstreaming JSON URL inputs. JSON requires model, prompt and 1-16 images with image_url; mask may contain one image_url. URL inputs use the selected upstream's native JSON Images API, so that channel must support URL edits. Model permissions, enterprise channel selection, funding and settlement apply to both inputs. URLs must use public HTTPS without embedded credentials; the gateway does not download them. Other native JSON parameters are preserved. gpt-image-2 defaults quality to medium. Malformed URL inputs, missing images, unsupported streaming, invalid image count and invalid quality return HTTP 400 before funding or provider dispatch.
POST /openai/v1/images/generationsVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/images/generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "A minimal paper sculpture of a cloud",
"n": 1
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "A minimal paper sculpture of a cloud",
"n": 1
}Các phản hồi
{
"created": 1700000000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
}
]
}Mô hình
5 điểm cuốiKhám phá các mô hình có sẵn qua từng giao thức.
Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/models' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "list",
"data": [
{
"id": "your-model-id",
"object": "model",
"created": 1767225600,
"owned_by": "configured-provider"
}
]
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/models' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "list",
"data": [
{
"id": "your-model-id",
"object": "model",
"created": 1767225600,
"owned_by": "configured-provider"
}
]
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/anthropic/v1/models' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"data": [
{
"id": "your-model-id",
"type": "model",
"display_name": "Configured model",
"created_at": "2026-01-01T00:00:00.000Z"
}
],
"has_more": false,
"first_id": "your-model-id",
"last_id": "your-model-id"
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/gemini/v1beta/models' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"models": [
{
"name": "models/your-model-id",
"displayName": "Configured model",
"supportedGenerationMethods": [
"generateContent"
],
"inputTokenLimit": 8192,
"outputTokenLimit": 8192
}
]
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1beta/models' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Edge computing reduces latency."
}
]
}
}
]
}Phương tiện không đồng bộ
23 điểm cuốiTạo và kiểm tra các tác vụ không đồng bộ về hình ảnh, video và nhạc.
Seedance chấp nhận các tham chiếu asset:// hình ảnh và video đang hoạt động, bao gồm nội dung hỗn hợp reference_image và reference_video. Mỗi tham chiếu phải thuộc thư viện tài sản hiện tại của doanh nghiệp. Tham chiếu đến thư viện không tương thích sẽ trả về HTTP 400 authorized_asset_provider_mismatch, retryable=false và user_action=simplify_input trước khi định tuyến, tạo tác vụ hoặc gửi lên upstream. Hãy đăng ký các hình ảnh và video được tham chiếu trong thư viện hiện tại và cập nhật tham chiếu của chúng trước khi thử lại.
POST /v1/videosVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/videos' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "video",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/videos/<task_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "video",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/videos/<task_id>/content' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/octet-stream'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
<binary>Seedance chấp nhận các tham chiếu asset:// hình ảnh và video đang hoạt động, bao gồm nội dung hỗn hợp reference_image và reference_video. Mỗi tham chiếu phải thuộc thư viện tài sản hiện tại của doanh nghiệp. Tham chiếu đến thư viện không tương thích sẽ trả về HTTP 400 authorized_asset_provider_mismatch, retryable=false và user_action=simplify_input trước khi định tuyến, tạo tác vụ hoặc gửi lên upstream. Hãy đăng ký các hình ảnh và video được tham chiếu trong thư viện hiện tại và cập nhật tham chiếu của chúng trước khi thử lại.
POST /openai/v1/videosVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/videos' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "video",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/videos/<task_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "video",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/videos/<task_id>/content' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/octet-stream'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
<binary>Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/audio/generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "audio",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/audio/generations/<task_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "audio",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/audio/generations/<task_id>/content' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/octet-stream'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
<binary>Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/openai/v1/audio/generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-name",
"prompt": "A calm landscape",
"duration_seconds": 5
}Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "audio",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/audio/generations/<task_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"id": "task_example",
"taskId": "task_example",
"object": "audio",
"status": "queued",
"created_at": 0
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/openai/v1/audio/generations/<task_id>/content' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/octet-stream'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
<binary>Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/async-tasks/image-generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "A minimal paper sculpture of a cloud"
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "A minimal paper sculpture of a cloud"
}Các phản hồi
{
"object": "async_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "image_generation",
"status": "submitted",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"anyint": {
"request_id": "req_example",
"route_decision_id": "route_example"
},
"duplicate": true
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/async-tasks/video-generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Slow aerial movement over a quiet coast",
"duration_seconds": 6,
"fps": 24
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Slow aerial movement over a quiet coast",
"duration_seconds": 6,
"fps": 24
}Các phản hồi
{
"object": "async_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "video_generation",
"status": "submitted",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"anyint": {
"request_id": "req_example",
"route_decision_id": "route_example"
},
"duplicate": true
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/videos/generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Slow aerial movement over a quiet coast",
"duration_seconds": 6,
"fps": 24
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Slow aerial movement over a quiet coast",
"duration_seconds": 6,
"fps": 24
}Các phản hồi
{
"object": "async_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "video_generation",
"status": "submitted",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"anyint": {
"request_id": "req_example",
"route_decision_id": "route_example"
},
"duplicate": true
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/async-tasks/music-generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Warm ambient music with soft piano",
"duration_seconds": 30
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Warm ambient music with soft piano",
"duration_seconds": 30
}Các phản hồi
{
"object": "async_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "music_generation",
"status": "submitted",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"anyint": {
"request_id": "req_example",
"route_decision_id": "route_example"
},
"duplicate": true
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/music/generations' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"prompt": "Warm ambient music with soft piano",
"duration_seconds": 30
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"prompt": "Warm ambient music with soft piano",
"duration_seconds": 30
}Các phản hồi
{
"object": "async_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "music_generation",
"status": "submitted",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"anyint": {
"request_id": "req_example",
"route_decision_id": "route_example"
},
"duplicate": true
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/async-tasks' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "list",
"data": [
{
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "image_generation",
"status": "queued",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
]
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/async-tasks/<task_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "async_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "image_generation",
"status": "queued",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/tasks/<task_id>' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "generation_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "image_generation",
"status": "queued",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/tasks/<task_id>/cancel' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "generation_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "image_generation",
"status": "queued",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/async-tasks/<task_id>/cancel' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"object": "generation_task",
"task": {
"id": "task_example",
"requestId": "req_example",
"tenantId": "tenant_example",
"protocol": "openai",
"taskType": "image_generation",
"status": "queued",
"input": {
"prompt": "Example prompt"
},
"artifacts": [],
"artifactCount": 0,
"artifact_count": 0,
"billingSessions": [],
"billing_sessions": [],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/async-tasks/<task_id>/artifacts/<artifact_id>?tenant_id=<tenant_id>&expires_at=<expires_at>&signature=<signature>' \
--header 'Accept: application/octet-stream'Xác thực
Không yêu cầu xác thực
Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| task_id | path | string | Bắt buộc | — |
| artifact_id | path | string | Bắt buộc | — |
| tenant_id | query | string | Bắt buộc | — |
| expires_at | query | integer | Bắt buộc | — |
| signature | query | string | Bắt buộc | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
<binary>Tin nhắn Anthropic
4 điểm cuốiSử dụng tin nhắn gốc Anthropic, đếm token và khám phá mô hình.
When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /anthropic/v1/messagesVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/anthropic/v1/messages' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Explain edge computing briefly."
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Explain edge computing briefly."
}
]
}Các phản hồi
{
"id": "msg_example",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Edge computing runs workloads near the data source."
}
]
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/anthropic/v1/messages/count_tokens' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}Các phản hồi
{
"input_tokens": 12
}When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /v1/messagesVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/messages' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Explain edge computing briefly."
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Explain edge computing briefly."
}
]
}Các phản hồi
{
"id": "msg_example",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Edge computing runs workloads near the data source."
}
]
}Ví dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1/messages/count_tokens' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"model": "your-model-id",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}Các phản hồi
{
"input_tokens": 12
}Nội dung Gemini
8 điểm cuốiSử dụng tính năng tạo và truyền nội dung gốc Gemini.
Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /gemini/v1beta/models/{model}:generateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/gemini/v1beta/models/<model>:generateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Edge computing reduces latency."
}
]
}
}
]
}Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /gemini/v1beta/models/{model}:streamGenerateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/gemini/v1beta/models/<model>:streamGenerateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: text/event-stream' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| alt | query | string | Tùy chọn | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
data: {"candidates":[{"content":{"role":"model","parts":[{"text":"Edge computing reduces latency."}]}}]}
Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /gemini/v1beta/models/{model}/generateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/gemini/v1beta/models/<model>/generateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Edge computing reduces latency."
}
]
}
}
]
}Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /gemini/v1beta/models/{model}/streamGenerateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/gemini/v1beta/models/<model>/streamGenerateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: text/event-stream' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| alt | query | string | Tùy chọn | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
data: {"candidates":[{"content":{"role":"model","parts":[{"text":"Edge computing reduces latency."}]}}]}
Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /v1beta/models/{model}:generateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1beta/models/<model>:generateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Edge computing reduces latency."
}
]
}
}
]
}Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /v1beta/models/{model}:streamGenerateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1beta/models/<model>:streamGenerateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: text/event-stream' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| alt | query | string | Tùy chọn | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
data: {"candidates":[{"content":{"role":"model","parts":[{"text":"Edge computing reduces latency."}]}}]}
Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /v1beta/models/{model}/generateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1beta/models/<model>/generateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Edge computing reduces latency."
}
]
}
}
]
}Gemini 4 Argon on the Gemini Developer API supports Standard inference only. Omit serviceTier/service_tier or set it to standard; other values return HTTP 400 before upstream dispatch. When billing is enabled, built-in web search declared in tools or Responses input.additional_tools requires a compiled price rule covering web_search_queries and the request dimensions. Namespace tool declarations are checked without treating client functions as built-in search. Before initial funding reservation, routing checks eligible, authorized candidates in order and skips candidates without required search pricing. Required channel/provider and continuation affinity restrictions remain enforced. If no permitted candidate has coverage, admission returns HTTP 503 search_tool_pricing_not_configured without provider dispatch or funding reservation. Each actual fallback and supply-tier candidate is checked again before dispatch; missing pricing never consumes a provider attempt. For enterprise postpaid requests, actual provider usage above the initial estimate is checked against remaining authorized budgets before settlement. Budget denial retains the recorded usage and price for reconciliation. Client function tools are unaffected. Native requests preserve provider parameters, subject to the selected model's official support. Cross-protocol requests map supported content and controls through a request IR. Unmapped extensions and approximate controls are recorded in conversion diagnostics without rejecting otherwise usable requests. Malformed source content still returns HTTP 400. Cross-protocol tool declarations that cannot be represented return HTTP 400 before funding rather than being silently discarded; eligible native routes may preserve native-only tools. Anthropic stop_sequences are mapped to Chat stop; an upstream-unreported matched sequence is not fabricated. Requests using Responses previous_response_id/conversation, Anthropic thread, or Gemini cachedContent require their server-side state. These references are never discarded even when input contains repeated history. Routing excludes conversions that cannot preserve state and prefers an eligible native route; state ownership still depends on the original provider/account and existing continuation affinity checks. If all candidates are excluded for this reason, HTTP 422 conversation_state_unavailable is returned before provider dispatch. The gateway does not currently materialize referenced history. Native protocol availability alone does not prove that a private state ID exists in the selected account. Fallback does not automatically downgrade json_schema to json_object. Configured deployments accept model=auto or auto-cn for Chat Completions, Responses, Anthropic Messages, and Gemini generateContent. Before feature scoring, auto routing filters native json_schema/json_object support, explicit thinking-off support, full input length plus the requested output reservation, and required input modalities. Text context length includes full system/history/tool definitions and results and JSON structure, using one UTF-16 character per estimated text token until tokenizer integration. Explicit media transport payloads are replaced with type placeholders for this estimate; Base64 length is not a media token count. Actual media token usage and limits remain provider-specific and are validated upstream. JSON and thinking-off support comes from published llm_capabilities (jsonSchema, jsonObject, reasoning, reasoningDisable); missing hard-capability facts do not count as support. Models without reasoning satisfy thinking-off. Reasoning strength, summary verbosity, hidden thoughts and optional output metadata do not filter candidates. When Redis is configured, Auto first checks a tenant-, API-key-, routing-mode- and protocol-scoped explicit client session binding, then a history fingerprint. Session extraction prefers X-Claude-Code-Session-Id, X-OpenCode-Session-Id, X-DeepSeek-Harness-Session-Id, X-QwenWork-Session-Id and thread-id, then Responses client_metadata session_id/thread_id and the same fields in JSON x-codex-turn-metadata. Generic X-Session-Id, session_id, session-id, X-Cursor-Session and X-OpenClaw-Session-Id follow, then body session_id, sessionId, metadata.session_id and metadata.sessionId. Anthropic also accepts session_id inside JSON metadata.user_id. X-Task-ID, X-OpenCode-Session and X-Session-Affinity are fallback identities only. A KimiCLI/ User-Agent additionally enables the known Chat Completions prompt_cache_key or Anthropic plain metadata.user_id session convention. Missing or malformed identifiers do not reject requests. User/account, request, prompt, turn and parent identifiers are not globally treated as session IDs. Session lookup failures still try history; both bindings update only on successful completion. History v2 excludes non-message roles/control items and incomplete tool-call identifiers; no User boundary means all available history is sampled. A valid hit skips Jev scoring and its routing fee after rechecking current candidate eligibility; if that bound model fails, Auto bypasses the binding and scores once to fill the remaining distinct model attempts. Misses and cache failures use normal scoring. Bindings expire after 24 hours and are written only after successful JSON or complete SSE responses; cancelled, incomplete, ambiguous or oversized streams do not create bindings. The smart router scores the remaining current gateway catalog models permitted by the API key and protocol, then the selected concrete model follows existing entitlement, channel routing and billing rules. For auto/auto-cn, Vertex Gemini text requests from Chat Completions, Responses and Anthropic use Vertex's OpenAI-compatible Chat endpoint with the same account, model and published Gemini tariff. Chat message/tool payloads are preserved; Responses and Anthropic are converted only to Chat. Auto requests containing video retain the native Gemini generateContent/streamGenerateContent conversion because Vertex Chat rejects video_url; media bytes, mixed audio, account and Gemini pricing are preserved. Explicit model requests and native Gemini/media paths retain their existing routing. Prices and context limits come from the current published catalog; missing context limits may use the versioned capability snapshot and are logged. Optional capability overrides do not define the candidate list. Task feature failures are recorded as degraded and use the neutral demand value. Missing configuration or scorer credentials, an invalid catalog, or no eligible model returns HTTP 503 (auto_routing_not_configured, auto_routing_configuration_invalid, auto_routing_scorer_unavailable, auto_routing_no_candidates). Selection failure returns auto_routing_failed. For Responses history, only message items (including omitted type) require role; non-message items stay in the full upstream request and are excluded from scoring. Jev receives only user/assistant text plus a system prefix of at most 500 weighted characters; tool definitions, calls/results and other roles are excluded. Image, audio, video and file content blocks are inspected across the full request before scoring. The published model input modalities must cover every attached input kind, and every selected or fallback channel must explicitly declare these kinds in metadata.input_modalities (inputModalities is also accepted); incompatible channels return capability_mismatch before dispatch. Unknown MIME types and opaque file references require file support. Media bytes, URLs and file IDs are excluded from Jev material and replaced with attachment-type placeholders; the original wire request is preserved. No multimodal demand feature or capability score is introduced. Non-text output, image-generation tools and server-stored Responses continuations still require an explicit model and return HTTP 400 auto_routing_request_unsupported. Auto tries the next ranked model after every unsuccessful model attempt, including any non-2xx response, generic HTTP 400 validation errors, provider refusals, 5xx, timeouts, transport errors and unclassified local execution failures. Failure classification and uncertain provider cost do not block fallback. Each attempt retains its own settlement evidence; retrying does not convert an uncertain provider outcome into confirmed zero cost. At most three distinct ranked models are attempted with one feature evaluation. Each attempt repeats existing authorization, quota, rate-limit, routing and funding checks under an independent execution ID. The public X-Request-Id remains stable; execution records and billing metadata retain their correlation. Client cancellation or successful response delivery stops cross-model fallback. Streams already delivered to the client are not restarted. Each candidate still must pass authorization and funding checks; a denied check never authorizes upstream dispatch. When all candidates fail, the final attempt error is returned. Explicit model requests do not use this fallback. After a successful final model execution that required Jev scoring, Auto adds one platform routing fee on the public parent request ID: min(20 * L / 1000000 + 0.01505, 0.2) credits, where L is the UTF-16 string length of the compressed Jev state (JSON serialization for an object), measured once across scorer calls. One USD equals 100 credits; fees round half away from zero to micro-USD (0.0001 credits). Failed or incomplete streams and failed final executions do not incur this fee. The billing model is auto, including auto-cn requests. Request-cost lookups for a public Auto request ID include its routing fee and all settled child execution charges.
POST /v1beta/models/{model}/streamGenerateContentVí dụ yêu cầu
curl \
--request POST \
--url 'https://api.anyint.ai/v1beta/models/<model>/streamGenerateContent' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: text/event-stream' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| model | path | string | Bắt buộc | — |
| alt | query | string | Tùy chọn | — |
| X-Client-Message-Id | header | string | Tùy chọn | Opt in to durable tenant-scoped execution deduplication. Reuse only with the identical request body and API key. Completed or possibly dispatched requests never expire into another execution, including after Redis loss. Upstream errors or settlement rollback after dispatch require a new message ID for another execution; failures before dispatch may retry the same ID. |
| X-Resume-Message-Id | header | string | Tùy chọn | Replay a previously generated SSE stream under the original API key and identical request body. This request does not dispatch or bill the provider. Cache retention is 10 minutes and total output is limited to 4 MiB; interrupted generations require a new message ID for continuation. |
| X-Resume-From-Offset | header | integer | Tùy chọn | Number of complete SSE events already consumed, matching the last SSE id. Starts at 0; UTF-8 bytes, tokens and characters are not valid units. Takes precedence over Last-Event-ID. |
| Last-Event-ID | header | integer | Tùy chọn | Alternative complete SSE event offset when X-Resume-From-Offset is absent. |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Nội dung yêu cầu
Bắt buộc{
"contents": [
{
"parts": [
{
"text": "Explain edge computing briefly."
}
]
}
]
}Các phản hồi
data: {"candidates":[{"content":{"role":"model","parts":[{"text":"Edge computing reduces latency."}]}}]}
Các điểm cuối khác (Knowledge Crystallization)
1 điểm cuốiExport crystallized AI conversation events for local Markdown notes sync.
Ví dụ yêu cầu
curl \
--request GET \
--url 'https://api.anyint.ai/v1/knowledge/export' \
--header 'Authorization: Bearer <ANYINT_API_KEY>' \
--header 'Accept: application/json'Xác thực
http · bearerTruyền khóa API nhà phát triển AnyInt dưới dạng mã thông báo Bearer trong tiêu đề Authorization.Tham số
| Tên | Vị trí | Loại | Bắt buộc | Mô tả |
|---|---|---|---|---|
| cursor | query | string | Tùy chọn | — |
| limit | query | integer | Tùy chọn | — |
| collection_id | query | string | Tùy chọn | — |
| X-Request-Id | header | string | Tùy chọn | Optional client correlation ID. Valid values (8–128 letters, digits, dots, underscores, colons or dashes) are retained only as a diagnostic hash. This header does not deduplicate requests. Each HTTP request receives a fresh gateway execution ID in the X-Request-Id response header; use that returned ID for support and request traces. Use the documented message recovery protocol for execution deduplication. |
Các phản hồi
{
"schema_version": "1.0.0",
"collection_id": "default",
"collection_generation": 1,
"events": [],
"next_cursor": null,
"has_more": false,
"snapshot_upper_bound": "2026-09-30T10:00:00.000Z",
"pending_summary": {
"pending_event_count": 0
},
"status": "OK"
}