Перейти к содержимому

Create response

POST
/responses
curl https://api.waibee.com/v1/responses \
-H "Authorization: Bearer $WAIBEE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.1-codex",
"input": "Hello!"
}'

OpenAI-compatible Responses call. Send the conversation as input, receive one response with its output items. Set stream: true for a Server-Sent Events stream of named events.

Stateless: the four fields that ask the server to remember the conversation for you are refused with feature_not_supported (400): store: true, previous_response_id, conversation and background: true. Send the whole conversation in input instead.

The built-in {"type": "web_search"} tool is executed by the router. Each search is billed on top of tokens, and the answer carries a waibee:web_search item naming the query and the sources.

Media typeapplication/json

Stateless subset of the Responses format. store: true, previous_response_id, conversation and background: true are refused with feature_not_supported (400): send the whole conversation in input instead.

object
model
required

<provider>/<model> from GET /v1/models. waibee/auto lets the router pick.

string
input
One of:
string
instructions

System prompt for this call.

string
stream

Stream the response as named Server-Sent Events.

boolean
max_output_tokens

Cap on the answer. It covers the whole request including the rounds a web search adds, not each round separately.

integer
tools

Function definitions (max 256), and the built-in {"type": "web_search"}, which the router executes itself.

Array<object>
object
key
additional properties
any
tool_choice
One of:
string
reasoning

Reasoning controls, e.g. {"effort": "low"}.

object
key
additional properties
any
plugins

Per-request plugins.

object
dlp

Data-loss-prevention scan, mask or block. Optional: a DLP policy set for your API key applies as a floor of strictness even when this object is absent, and this object can only make the check stricter. entity_types is unioned with the policy’s categories, so the scan may be wider than the list you send.

object
mode

Applies to the rules you declare yourself. Where the key’s policy declares the same rule, the stricter of the two modes wins; the policy’s own categories keep the mode the administrator set.

string
Allowed values: alert mask block
entity_types

Unioned with the categories of the key’s policy, never narrowing them.

Array<string>
report_scope

Which messages’ findings come back to you. Narrowing it does not narrow the scan: every message is still scanned, and the block decision counts every finding.

string
default: all
Allowed values: all last_message latest_user_message
stop_words

Values that are a finding on their own, whatever the categories say. Unioned with the key’s policy.

Array<object>
object
value
required
string
match
string
default: exact
Allowed values: exact fuzzy
allowlist

Exceptions, matched on the whole value only. They reach your own rules only: an exception never lifts a finding raised by a rule of the key’s policy. Within your own config a stop word beats an exception on the same value.

Array<object>
object
value
required
string
match

Exact only. A substring exception would exempt every lookalike containing it.

string
default: exact
Allowed values: exact
regexes

Named patterns, run by RE2. Unioned with the key’s policy.

Array<object>
object
name
required
string
pattern
required
string
injected_context_names

Marks a message as inserted by the platform rather than typed by a person, by the value of its name field, and takes it out of the scan. Ignored while a policy applies to your key: on this path the same caller supplies both the marker and the content, so it would be a way to opt out of the check.

Array<string>
acknowledged

Reserved, and currently changes nothing: alert reports the findings and forwards the request, so there is no hold to confirm.

boolean
store

Only false is accepted; true is refused as unsupported.

boolean
key
additional properties
any

Model response.

Media typeapplication/json

One response. output carries the items the model produced: reasoning, messages, function calls, and a waibee:web_search item for each search the router ran.

object
id
string
object
string
created_at
integer
model
string
status

completed, or incomplete when the answer was cut short. The reason is in incomplete_details.reason.

string
incomplete_details

Present when status is incomplete.

object
key
additional properties
any
output
Array<object>
object
key
additional properties
any
usage

input_tokens, output_tokens, total_tokens, summed over every round.

object
key
additional properties
any
key
additional properties
any
Example
{
"id": "resp_b6dc6e06093b437394bc2005fcfaff25",
"object": "response",
"status": "completed"
}

Invalid request. Codes: validation_error, feature_not_supported.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "invalid_request_error",
"code": "feature_not_supported",
"message": "'store' is not supported: this endpoint is stateless. Send the whole conversation in `input`.",
"param": "store"
}
}

Missing or invalid API key.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API key"
}
}

Request refused. The code names the reason: insufficient_funds, policy_violation, dlp_violation, model_not_found, payload_too_large, rate_limited.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "invalid_request_error",
"code": "model_not_found",
"message": "Model is not available"
}
}

Request refused. The code names the reason: insufficient_funds, policy_violation, dlp_violation, model_not_found, payload_too_large, rate_limited.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "invalid_request_error",
"code": "model_not_found",
"message": "Model is not available"
}
}

Request refused. The code names the reason: insufficient_funds, policy_violation, dlp_violation, model_not_found, payload_too_large, rate_limited.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "invalid_request_error",
"code": "model_not_found",
"message": "Model is not available"
}
}

Upstream trouble: provider_timeout (408), provider_unavailable (502), service_unavailable and dlp_unavailable (503).

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "api_error",
"code": "provider_unavailable",
"message": "Provider unavailable"
}
}

Request refused. The code names the reason: insufficient_funds, policy_violation, dlp_violation, model_not_found, payload_too_large, rate_limited.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "invalid_request_error",
"code": "model_not_found",
"message": "Model is not available"
}
}

Invalid request. Codes: validation_error, feature_not_supported.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "invalid_request_error",
"code": "feature_not_supported",
"message": "'store' is not supported: this endpoint is stateless. Send the whole conversation in `input`.",
"param": "store"
}
}

Request refused. The code names the reason: insufficient_funds, policy_violation, dlp_violation, model_not_found, payload_too_large, rate_limited.

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "invalid_request_error",
"code": "model_not_found",
"message": "Model is not available"
}
}

Upstream trouble: provider_timeout (408), provider_unavailable (502), service_unavailable and dlp_unavailable (503).

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "api_error",
"code": "provider_unavailable",
"message": "Provider unavailable"
}
}

Upstream trouble: provider_timeout (408), provider_unavailable (502), service_unavailable and dlp_unavailable (503).

Media typeapplication/json

Responses-format error envelope (used by POST /v1/responses).

object
error
object
type
required

Coarse category, e.g. invalid_request_error, authentication_error.

string
code
required
string
message
required
string
param

The field the request was rejected for, when one field is to blame.

string
details
object
key
additional properties
any
Example
{
"error": {
"type": "api_error",
"code": "provider_unavailable",
"message": "Provider unavailable"
}
}