Completions
Create completion
For sending requests to legacy completion models
post/v2/router/completions
Request body
Example request
{
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"cache": {
"ttl": 3600
},
"load_balancer": {
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
}
]
},
"timeout": {
"call_timeout": 30000
},
"orq": {
"retry": {
"count": 3,
"on_codes": [
429,
500,
502
]
},
"fallbacks": [
{
"model": "openai/gpt-5"
},
{
"model": "anthropic/claude-4-opus"
}
],
"identity": {
"id": "identity_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com"
},
"thread": {
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support"
]
},
"inputs": {
"customer_name": "John Smith",
"issue_type": "billing"
},
"cache": {
"ttl": 3600,
"type": "exact_match"
},
"knowledge_bases": [
{
"knowledge_id": "knowledge_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"top_k": 5
}
],
"timeout": {
"call_timeout": 30000
},
"security": {
"mask": [
"input",
"system"
]
}
}
}Response
Represents a completion response from the API.