Create decision
POST/decisions
Preview. Answers typed questions about an input with calibrated probabilities instead of generated text, in the format of OpenAI's Decisions API (client.decisions.create in OpenAI's Python SDK). Each question is a predicate (yes or no), a choice (one of several typed values) or a score (one of 2 to 10 ordered levels); the answers come back in question order.
Only decision models can be used: GET /v1/models?format=openai lists them, each with endpoints. Only input tokens are billed. There is no streaming. Only Serenity Edge API keys can use this route; a key from a Serenity Star account gets 403 permission_denied for now. Until the service is enabled, the route answers 404 like an unknown path. See the Decisions guide.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 413
- 429
- 500
- 503
The answers, one per question in question order, with the versioned id of the model that answered and the token usage.
The request was refused: malformed body, missing model, an unknown question type, an invalid option or level, an image the model cannot read, or an input longer than the model's context (code: context_length_exceeded). The message says what to fix and param points at the parameter when it is known.
Missing or invalid API key.
The key is valid but cannot use the decision API. For now only Serenity Edge API keys can; keys from a Serenity Star account cannot yet.
The model is not a decision model (chat models cannot be used here), or the route is not enabled yet and answers like an unknown path.
The request body is larger than the gateway accepts (4 MB, or 12 MiB on orion-compass-flash and d3).
Rate limit exceeded, or the service is temporarily at capacity for this model. Wait for the number of seconds in the Retry-After header before retrying.
Response Headers
Seconds to wait before retrying.
Unexpected server error: the model service returned an unexpected response (upstream_error), the request got no answer within 600 seconds (timeout), or an error in the gateway. Retry with backoff.
The model service is temporarily unavailable (upstream_unavailable). Retry later and check the status page at https://status.serenityedge.ai.