Create embeddings
curl https://api.waibee.com/v1/embeddings \ -H "Authorization: Bearer $WAIBEE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/text-embedding-3-small", "input": ["Hello!", "Goodbye!"] }'from openai import OpenAI
client = OpenAI(base_url="https://api.waibee.com/v1", api_key="sk_live_...")resp = client.embeddings.create( model="openai/text-embedding-3-small", input=["Hello!", "Goodbye!"], encoding_format="float",)print(len(resp.data[0].embedding))OpenAI-compatible embeddings: one vector per input, in input order.
Serves models of class embedding only
(GET /v1/models?output_modalities=embeddings). A model of another
class is refused with model_endpoint_mismatch (400), and
waibee/auto with feature_not_supported (400). No streaming.
Text input only: token arrays and multimodal items are refused with
validation_error (422). With encoding_format: base64 each vector
is base64 of little-endian float32, the layout the OpenAI SDKs decode.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Fields not listed here are dropped, not forwarded to the model.
object
<provider>/<model> of an embedding model from GET /v1/models.
base64 is little-endian float32, the layout the OpenAI SDKs decode.
Length of the vector. Sent to the model only when given; not every model supports it.
Per-request plugins.
object
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
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.
Unioned with the categories of the key’s policy, never narrowing them.
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.
Values that are a finding on their own, whatever the categories say. Unioned with the key’s policy.
object
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.
object
Exact only. A substring exception would exempt every lookalike containing it.
Named patterns, run by RE2. Unioned with the key’s policy.
object
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.
Reserved, and currently changes nothing: alert reports the findings and forwards the request, so there is no hold to confirm.
Keep masks in the response text, reasoning and tool call arguments instead of revealing them, the same with and without streaming. Under block a finding in message text is masked instead of rejecting the request. On its own this field does not turn DLP on.
Responses
Section titled “Responses”One vector per input.
object
object
Base64, when encoding_format is base64.
object
Present when DLP in mask or alert mode found something. On /v1/embeddings and /v1/systemone a finding’s location is the path of the element (input[1], state.customer.email) and its message_index is -1.
object
object
Example
{ "object": "list", "data": [ { "object": "embedding", "embedding": [ -0.0067291259765625, -0.0391845703125, 0.034149169921875 ], "index": 0 }, { "object": "embedding", "embedding": [ -0.0149688720703125, 0.038238525390625, -0.0276336669921875 ], "index": 1 } ], "model": "text-embedding-3-small", "usage": { "prompt_tokens": 6, "total_tokens": 6 }}Invalid request. Codes: invalid_model, feature_not_supported, model_endpoint_mismatch, provider_bad_request, provider_context_length_exceeded.
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Examples
Unknown model
{ "error": { "code": "invalid_model", "message": "Model 'foo' is not available", "extra": {} }}The endpoint does not serve this model's class
{ "error": { "code": "model_endpoint_mismatch", "message": "Model openai/text-embedding-3-small is of class embedding, which this endpoint does not serve", "extra": { "model": "openai/text-embedding-3-small", "model_class": "embedding", "endpoint": "chat_completions" } }}Missing or invalid API key: authentication_required or invalid_api_key.
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Examples
No Authorization header
{ "error": { "code": "authentication_required", "message": "Authorization header is required", "extra": {} }}The key is not valid
{ "error": { "code": "invalid_api_key", "message": "Invalid API key", "extra": {} }}Not enough credits for the request (insufficient_funds).
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Example
{ "error": { "code": "insufficient_funds", "message": "Insufficient credits", "extra": {} }}Request blocked by an access policy (policy_violation) or by DLP (dlp_violation). A DLP block is about the content of the request, not about the key’s permissions: branch on error.code, not on the status alone.
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Examples
Model not allowed for this group
{ "error": { "code": "policy_violation", "message": "Request blocked by policy", "extra": {} }}Sensitive data detected in block mode
{ "error": { "code": "dlp_violation", "message": "Request blocked: sensitive data detected", "extra": { "dlp": [ { "category": "pii", "entity_type": "EMAIL", "message_index": 0, "location": "messages[0].content", "start": 12, "end": 28, "confidence": 0.98 } ], "findings_count": 1, "block_scope": "in_report_scope" } }}Model not in the catalog (model_not_found).
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Example
{ "error": { "code": "model_not_found", "message": "Model 'nonexistent/model' is not available. Check the model name and try again.", "extra": {} }}Upstream took too long, including a stream that went silent (provider_timeout).
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Example
{ "error": { "code": "provider_timeout", "message": "Provider timed out", "extra": {} }}Request body, a file or the aggregate text exceeds the limit: payload_too_large, file_too_large, text_content_too_large.
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Example
{ "error": { "code": "payload_too_large", "message": "Request body too large", "extra": {} }}Request failed validation (validation_error): model not in <provider>/<model> form, or a missing field.
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Example
{ "error": { "code": "validation_error", "message": "Invalid request: body.model: Value error, model must be in format \"<provider>/<model>\"", "extra": { "errors": [ { "type": "value_error", "loc": [ "body", "model" ], "msg": "Value error, model must be in format \"<provider>/<model>\"" } ] } }}Provider rate limit (provider_rate_limited), or the API key’s spending limit for the period (api_key_limit_exceeded, reset time in extra.reset_at).
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Example
{ "error": { "code": "provider_rate_limited", "message": "Rate limit exceeded", "extra": {} }}Upstream model unavailable (provider_unavailable).
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Example
{ "error": { "code": "provider_unavailable", "message": "Provider unavailable", "extra": {} }}Temporarily unavailable. service_unavailable means the router is under load; dlp_policy_unavailable means the DLP policy for the key could not be resolved, and the request was refused rather than run unscanned. Both carry Retry-After. An internal failure arrives as internal_service_error.
OpenAI-format error envelope.
object
object
Additional error data; fields depend on the error code.
object
Examples
Router under load
{ "error": { "code": "service_unavailable", "message": "Service temporarily unavailable due to high load", "extra": {} }}DLP policy could not be resolved (retryable)
{ "error": { "code": "dlp_policy_unavailable", "message": "DLP policy is temporarily unavailable; retry the request", "extra": {} }}Headers
Section titled “Headers”Seconds to wait before retrying.