Skip to content
Home

OdiRouter Model API

Model API provides different invocation protocols for different model types. Multimodal models usually use an asynchronous task protocol: create a task, poll its status, and retrieve the result. Large language models usually use synchronous or streaming protocols, returning text or incremental output within a single request.

CapabilityMethodPathNotes
Model listGET/v1/modelsList available models
Chat CompletionsPOST/v1/chat/completionsOpenAI-compatible messages
ResponsesPOST/v1/responsesUnified Responses API
Multimodal submitPOST/model/v1/queue/{endpoint}Creates a queue request for the endpoint
Task statusGET/model/v1/queue/{endpoint}/requests/{request_id}/statusReturns the current task status
Result fetchGET/model/v1/queue/{endpoint}/requests/{request_id}/responseReturns the result after completion
Task cancellationPUT/model/v1/queue/{endpoint}/requests/{request_id}/cancelCancels the task when supported
Sora-style videoPOST/v1/videosSeparate multipart video endpoint

OdiRouter LLM API is for Chat Completions and Responses API calls. Endpoints use the unified /v1 prefix, and the platform handles API Key authentication, balance checks, and request tracing.

Окно терминала
export BASE_URL="https://odirouter.ai/v1"
export API_KEY="YOUR_API_KEY"
curl -sS "${BASE_URL}/chat/completions" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-H "X-Request-Id: demo-$(date +%s)" \
-d '{
"model": "gpt-4.1",
"messages": [
{
"role": "user",
"content": "Introduce OdiRouter LLM API in one sentence"
}
],
"temperature": 0.7
}'

Multimodal models use an asynchronous queue protocol: create a task, poll its status, and retrieve the result after completion. To stop execution, send a cancellation request. The endpoint in the URL directly uses the OdiRouter model ID, and the request body directly passes the model parameter object.

Окно терминала
export BASE_URL="https://odirouter.ai/model"
export ENDPOINT="nano_banana_2"
export API_KEY="YOUR_API_KEY"
COMMON_HEADERS=(
-H "Authorization: Bearer ${API_KEY}"
-H "Content-Type: application/json"
)
SUBMIT_RESPONSE="$(curl -sS -X POST "${BASE_URL}/v1/queue/${ENDPOINT}" \
"${COMMON_HEADERS[@]}" \
-d '{
"prompt": "a cinematic photo of a cat astronaut"
}')"
echo "${SUBMIT_RESPONSE}" | jq .
REQUEST_ID="$(echo "${SUBMIT_RESPONSE}" | jq -r '.request_id')"
STATUS_URL="$(echo "${SUBMIT_RESPONSE}" | jq -r '.status_url')"
RESPONSE_URL="$(echo "${SUBMIT_RESPONSE}" | jq -r '.response_url')"
while true; do
STATUS_RESPONSE="$(curl -sS "${STATUS_URL}" "${COMMON_HEADERS[@]}")"
echo "${STATUS_RESPONSE}" | jq .
STATUS="$(echo "${STATUS_RESPONSE}" | jq -r '.status')"
ERROR="$(echo "${STATUS_RESPONSE}" | jq -r '.error // empty')"
if [ "${STATUS}" = "COMPLETED" ]; then
if [ -n "${ERROR}" ]; then
echo "task failed: ${ERROR}"
exit 1
fi
break
fi
sleep 3
done
curl -sS "${RESPONSE_URL}" "${COMMON_HEADERS[@]}" | jq .