API reference
Errors, limits & billing
Errors#
Errors return JSON with an error (or detail) message that says what to fix.
{ "error": "Choice 'intent' criteria must map 2 to 256 options" }
Retry-After seconds, then retry.Retry-After: 90, about 1.5 to 2 minutes; see Status), or temporarily unavailable. Retry with backoff.Retries
Limits#
429 with Retry-After. Need more? Email us.429.429.Billing#
You pay for what you send, counted once: $0.042 per million input tokens. Decisions have no output to pay for; text written by generate is billed at the same rate. Nothing about how Wity reaches the answer is billed. See Pricing for examples.
Billing is prepaid. Every account starts with $5 of credit, which is spent first and expires 48 hours after sign-up; add more by card on the console's Billing page, and that never expires. Each successful call is charged to the balance of the key's account, and failed calls cost nothing. Once the balance reaches zero, calls answer 402 with "code": "insufficient_credits" until you top up; a call already running when credit runs out still finishes.
usage.input_tokensis your request (state, instructions and criteria) counted once per question.usage.output_tokensis 0 for decisions; for generate it reports the text written, billed at the input rate.- An extraction is billed on its
usage.input_tokens: the document and the field list, counted once. No output tokens. - A split is billed on its
usage.input_tokens: about the text's tokens plus a few hundred. Texts over about 5,000 characters are read in overlapping windows and count up to about twice. No output tokens. - Skills: a skill question is billed like the question it saves, plus each of its parts. Adding examples is billed once, on the tokens of their states. Learning, and reading or managing skills, is free.
- Sessions: a decision is billed on what it reads, like the same request to
/v1/systemone; a repeat answered from the session ("cached": true) costs nothing, and so do events and reads. - Each question is billed with the state it reads, so several questions cost about the sum of asking each. Asking them in one request saves round trips, not tokens; keep the state to what the decisions need.
Privacy#
Request and response bodies are not logged. We keep only operational records: which key made a request, when, its status and how long it took.
