Inference
Create a routed chat completion
Send an OpenAI-compatible non-streaming or streaming inference request through OpenWaya routing. Standard SDK fields are preserved; provider and route-attempt evidence is namespaced under openwaya.
AuthenticationBearer OPENWAYA_API_KEYRequest bodyOpenAIChatCompletionRequestSuccess responseOpenAIChatCompletionResponseResponse formatapplication/json · text/event-stream
Parameters
Idempotency-Keyheader · optionalCaller-generated idempotency key for safely retrying mutations. length 16–255
Request fields
max_completion_tokensintegeroptional>0, ≤1000000
max_tokensintegeroptional>0, ≤1000000
messagesarray<object>requireditems 1–10000
metadataobjectoptionalSee the downloadable schema for nested constraints.
modelstringrequiredlength 1–512
openwayaobjectoptionalSee the downloadable schema for nested constraints.
parallel_tool_callsbooleanrequireddefault true
response_formatobjectoptionalSee the downloadable schema for nested constraints.
seedintegeroptionalrange 0–2147483647
stopstring | array<string> | nulloptionalSee the downloadable schema for nested constraints.
streambooleanrequireddefault false
stream_optionsobjectoptionalSee the downloadable schema for nested constraints.
temperaturenumberoptionalrange 0–2
tool_choicestring | objectoptionalSee the downloadable schema for nested constraints.
toolsarray<object>optionalitems 0–128
top_pnumberoptionalrange 0–1
userstringoptionallength 1–255
Success fields
choicesarray<object>requireditems 1–∞
createdintegerrequiredrange 0–9007199254740991
idstringrequiredlength 8–96
modelstringrequiredlength 1–512
objectstringrequiredconstant chat.completion
openwayaobjectrequiredSee the downloadable schema for nested constraints.
usageobjectrequiredSee the downloadable schema for nested constraints.
Responses
200A completed response or a stream of ordered chunks.
400A normalized error with a stable code and request ID.
401A normalized error with a stable code and request ID.
402A normalized error with a stable code and request ID.
404A normalized error with a stable code and request ID.
422A normalized error with a stable code and request ID.
429A normalized error with a stable code and request ID.
500A normalized error with a stable code and request ID.
503A normalized error with a stable code and request ID.
504A normalized error with a stable code and request ID.
Inference
Create embeddings
Create one or more ordered float embedding vectors through the same tenant-scoped routing, quota, settlement, and provider-attempt boundary. Token-array input and base64 encoding are rejected rather than ignored.
AuthenticationBearer OPENWAYA_API_KEYRequest bodyOpenAIEmbeddingRequestSuccess responseOpenAIEmbeddingResponseResponse formatapplication/json
Parameters
Idempotency-Keyheader · optionalCaller-generated idempotency key for safely retrying mutations. length 16–255
Request fields
dimensionsintegeroptional>0, ≤65536
encoding_formatstringrequiredconstant float · default float
inputstring | array<string>requiredSee the downloadable schema for nested constraints.
modelstringrequiredlength 1–512
openwayaobjectoptionalSee the downloadable schema for nested constraints.
userstringoptionallength 1–255
Success fields
dataarray<object>requireditems 1–2048
modelstringrequiredlength 1–512
objectstringrequiredconstant list
openwayaobjectrequiredSee the downloadable schema for nested constraints.
usageobjectrequiredSee the downloadable schema for nested constraints.
Responses
200An ordered list of float embedding vectors and normalized usage.
400A normalized error with a stable code and request ID.
401A normalized error with a stable code and request ID.
402A normalized error with a stable code and request ID.
404A normalized error with a stable code and request ID.
409A normalized error with a stable code and request ID.
422A normalized error with a stable code and request ID.
429A normalized error with a stable code and request ID.
500A normalized error with a stable code and request ID.
503A normalized error with a stable code and request ID.
504A normalized error with a stable code and request ID.
Consensus
Create a metered multi-model consensus
Run two to five independent model responses through OpenWaya's secured Drux-backed consensus operation. The response preserves each child outcome, agreement, dissent, provider-native score semantics, normalized usage, and the settled OpenWaya charge.
AuthenticationBearer OPENWAYA_API_KEYRequest bodyConsensusRequestSuccess responseConsensusResponseResponse formatapplication/json
Parameters
Idempotency-Keyheader · optionalCaller-generated idempotency key for safely retrying mutations. length 16–255
Request fields
contractVersionstringrequiredconstant 1.0
deepSynthesisbooleanrequireddefault false
idempotencyKeystringoptionallength 16–255
maximumChargeobjectoptionalSee the downloadable schema for nested constraints.
modelSetIdstringoptionallength 8–96
modelsarray<string>optionalitems 2–5
promptstringrequiredlength 1–100000
webGroundingbooleanrequireddefault false
Success fields
consensusobject | nullrequiredSee the downloadable schema for nested constraints.
providerUsageobjectrequiredSee the downloadable schema for nested constraints.
requestedModelsarray<string>requireditems 2–5
resultsarray<object>requireditems 2–5
statusstringrequiredcomplete | degraded
usageobjectrequiredSee the downloadable schema for nested constraints.
billingobjectrequiredSee the downloadable schema for nested constraints.
contractVersionstringrequiredconstant 1.0
createdAtstringrequireddate-time
enginestringrequiredconstant drux
idstringrequiredlength 8–96
modelSetIdstring | nullrequiredSee the downloadable schema for nested constraints.
Responses
200A complete or explicitly degraded multi-model consensus result.
400A content-free consensus error with a stable code and request ID.
401A content-free consensus error with a stable code and request ID.
402A content-free consensus error with a stable code and request ID.
408A content-free consensus error with a stable code and request ID.
409A content-free consensus error with a stable code and request ID.
422A content-free consensus error with a stable code and request ID.
429A content-free consensus error with a stable code and request ID.
503A content-free consensus error with a stable code and request ID.
504A content-free consensus error with a stable code and request ID.
Models
List models
List models available to the authenticated organization with their lifecycle, capabilities, limits, and current USD price-book rates.
AuthenticationBearer OPENWAYA_API_KEYSuccess responseOpenAIModelListResponse formatapplication/json
Request fields
This operation has no JSON request body.
Success fields
dataarray<object>requireditems 0–1000
objectstringrequiredconstant list
Responses
200The organization-visible model registry.
401A normalized error with a stable code and request ID.
429A normalized error with a stable code and request ID.
500A normalized error with a stable code and request ID.
Models
Retrieve a model
Retrieve the current public contract for one organization-visible model.
AuthenticationBearer OPENWAYA_API_KEYSuccess responseOpenAIModelResponse formatapplication/json
Parameters
modelpath · requiredOpenWaya model identifier. length 1–255
Request fields
This operation has no JSON request body.
Success fields
createdintegerrequiredrange 0–9007199254740991
idstringrequiredlength 1–255
objectstringrequiredconstant model
openwayaobjectrequiredSee the downloadable schema for nested constraints.
owned_bystringrequiredlength 1–255
Responses
401A normalized error with a stable code and request ID.
404A normalized error with a stable code and request ID.
429A normalized error with a stable code and request ID.
500A normalized error with a stable code and request ID.
Inference
Create a routed response
Create an OpenAI-compatible, non-stored text response through OpenWaya routing. The bounded subset supports ordered streaming lifecycle events and rejects unsupported tools, conversation state, images, and background processing rather than ignoring them.
AuthenticationBearer OPENWAYA_API_KEYRequest bodyOpenAIResponseRequestSuccess responseOpenAIResponseResponse formatapplication/json · text/event-stream
Parameters
Idempotency-Keyheader · optionalCaller-generated idempotency key for safely retrying mutations. length 16–255
Request fields
inputstring | array<object>requiredSee the downloadable schema for nested constraints.
instructionsstringoptionallength 0–1000000
max_output_tokensintegeroptional>0, ≤1000000
metadataobjectoptionalSee the downloadable schema for nested constraints.
modelstringrequiredlength 1–512
openwayaobjectoptionalSee the downloadable schema for nested constraints.
safety_identifierstringoptionallength 1–64
storebooleanrequiredconstant false · default false
streambooleanrequireddefault false
stream_optionsobjectoptionalSee the downloadable schema for nested constraints.
temperaturenumberoptionalrange 0–2
textobjectoptionalSee the downloadable schema for nested constraints.
top_pnumberoptionalrange 0–1
truncationstringrequiredconstant disabled · default disabled
userstringoptionallength 1–255
Success fields
completed_atintegerrequiredrange 0–9007199254740991
created_atintegerrequiredrange 0–9007199254740991
errornullrequiredSee the downloadable schema for nested constraints.
idstringrequiredSee the downloadable schema for nested constraints.
incomplete_detailsnullrequiredSee the downloadable schema for nested constraints.
instructionsstringnullrequiredSee the downloadable schema for nested constraints.
max_output_tokensinteger | nullrequiredSee the downloadable schema for nested constraints.
metadataobject | nullrequiredSee the downloadable schema for nested constraints.
modelstringrequiredlength 1–512
objectstringrequiredconstant response
openwayaobjectrequiredSee the downloadable schema for nested constraints.
outputarray<object>requireditems 1–∞
output_textstringrequiredSee the downloadable schema for nested constraints.
parallel_tool_callsbooleanrequiredconstant false
safety_identifierstring | nullrequiredSee the downloadable schema for nested constraints.
statusstringrequiredconstant completed
storebooleanrequiredconstant false
temperaturenumber | nullrequiredSee the downloadable schema for nested constraints.
tool_choicestringrequiredconstant none
toolsarray<value>requiredSee the downloadable schema for nested constraints.
top_pnumber | nullrequiredSee the downloadable schema for nested constraints.
truncationstringrequiredconstant disabled
usageobjectrequiredSee the downloadable schema for nested constraints.
userstringnullrequiredSee the downloadable schema for nested constraints.
Responses
200A completed response or ordered stream of typed lifecycle events.
400A normalized error with a stable code and request ID.
401A normalized error with a stable code and request ID.
402A normalized error with a stable code and request ID.
404A normalized error with a stable code and request ID.
409A normalized error with a stable code and request ID.
422A normalized error with a stable code and request ID.
429A normalized error with a stable code and request ID.
500A normalized error with a stable code and request ID.
503A normalized error with a stable code and request ID.
504A normalized error with a stable code and request ID.
Stable client decisions
Errors are part of the contract.
Standard inference and model operations return one normalized envelope. Branch on the stable code and retryable value, not on message text. Keep the request ID for support; never attach prompts, outputs, or credentials.
{
"contractVersion": "1.0",
"error": {
"type": "openwaya_error",
"code": "model_unavailable",
"message": "No healthy route is currently available.",
"retryable": true
},
"requestId": "req_0123456789abcdef0123456789abcdef",
"timestamp": "2026-09-09T00:00:00.000Z"
}
Normalized error codes
authentication_required401do not retry unchangedSend a server-side Bearer API key.
authorization_denied403do not retry unchangedUse a key whose scope permits this operation.
invalid_request400do not retry unchangedCorrect the named field or compare the body with the current schema.
invalid_api_key401do not retry unchangedReplace, rotate, or reactivate the key; never log its value.
rate_limit_exceeded429retryableWait for the published reset and reduce request or token pressure.
insufficient_balance402do not retry unchangedFund the workspace or reduce the bounded maximum charge.
model_not_found404do not retry unchangedChoose a model returned by the authenticated model catalog.
model_unavailable503retryableRetry with backoff or choose another eligible catalog model.
provider_unavailable503retryableRetry with backoff; honor Retry-After when it is present.
request_timeout504retryableRetry only within the caller deadline using the same idempotency key.
content_rejected422do not retry unchangedChange the rejected content; do not retry it unchanged.
conflict409do not retry unchangedRefresh the resource state and submit a deliberate new mutation.
idempotency_conflict409do not retry unchangedReuse a key only for the byte-equivalent logical request.
payment_required402do not retry unchangedComplete the required funding step before retrying the operation.
payment_failed422retryableVerify the payment state before attempting a new checkout.
configuration_invalid503retryableRetry with backoff while OpenWaya restores valid routing configuration.
internal_error500retryableRetry with bounded backoff; report the request ID if it persists.
Consensus error codes
Consensus uses a deliberately smaller content-free envelope with only code and requestId. Its operation is billable and multi-stage, so follow the action before retrying.
CONSENSUS_DISABLED503Enable a reviewed consensus configuration before sending more work.
CONSENSUS_PROVIDER_BUSY503Retry with bounded backoff and the same idempotency key.
CONSENSUS_PROVIDER_TIMEOUT504Retry within the caller deadline using the same idempotency key.
CONSENSUS_PROVIDER_UNAVAILABLE503Retry with bounded backoff or use a different reviewed model set.
CONSENSUS_REQUEST_ABORTED408Check the request log before deliberately retrying the logical request.
CONSENSUS_REQUEST_REJECTED422Change the rejected request; do not retry it unchanged.
CONSENSUS_REQUEST_REPLAYED409Retrieve the original result; do not create a second billable request.
CONSENSUS_RESERVATION_FAILED402Fund the workspace or lower maximumCharge before a new request.
CONSENSUS_SETTLEMENT_PENDING503Do not replay; inspect the original request while settlement reconciles.
CONSENSUS_UNAVAILABLE503Retry with bounded backoff and report the request ID if it persists.
INVALID_API_KEY401Replace or rescope the key without exposing its value.
INVALID_CONSENSUS_REQUEST400Correct the body against ConsensusRequest before retrying.
INVALID_IDEMPOTENCY_KEY400Use one 16–255 character key in the header or body, with equal values if both exist.
Retry contract
- Set a caller deadline and a maximum attempt count.
- Retry only a retryable outcome with exponential backoff and jitter.
- Honor Retry-After and the request/token reset headers when present.
- Reuse the idempotency key only for the identical logical request.
- Stop and reconcile by request ID when completion or settlement is uncertain.