Skip to content
Menu
Base URLhttps://api.getworg.com/v1

Responses and usage

A response has the OpenAI shape. usage says what the request used, and that is what Worg bills.

Response

Response
{
  "id": "chatcmpl-req_tVJMBaXIcyDHuiQT2Ljh8WAG",
  "object": "chat.completion",
  "created": 1793729613,
  "model": "deepseek-v4.1-flash:cached",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Halo!" },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 4,
    "total_tokens": 13,
    "prompt_tokens_details": { "cached_tokens": 0 }
  }
}
  • id is chatcmpl- followed by the request ID, the same value as the x-request-id header. In a stream every chunk carries the same id.
  • model is the lane that answered. When you sent a renamed ID, it is the current ID. Through a combo, it is the lane that served the request.
  • message has content, reasoning_content when the model reasoned (see Reasoning), and tool_calls when it called a function.
  • logprobs is null unless you asked for it on a lane that returns it (see lane differences).

Finish reasons

  • stop: the model finished, or reached one of your stop strings.
  • length: the output reached max_tokens. The text is cut off, so JSON output may not parse.
  • tool_calls: the model wants your code to run the functions in tool_calls.

Token usage

  • prompt_tokens counts all input: messages, tool definitions, and images.
  • prompt_tokens_details.cached_tokens is the part of the input served from the model's cache. It is billed at the cached rate. Cache hits are not guaranteed; they come when a request repeats the start of a recent one.
  • completion_tokens counts all output, reasoning included. Reasoning tokens are not reported separately, because not every lane reports them.
  • With reasoning on, prompt_tokens is a little higher for the same messages (16 tokens became 42 in one test), because the model's template adds instructions.

How a request is billed

Worg multiplies each kind of token by the lane's price per 1M tokens and rounds the sum up to a whole micro-dollar (US$0.000001). New input isprompt_tokens minus cached_tokens. The price is the one in force when the request ran, and it is recorded with the request.

Example: a request on deepseek-v4.1-flash:cached with a long document in the system message, sent a second time a few seconds after the first. 5,774 of its 6,277 prompt tokens came from the cache.

PartTokensUS$ per 1MMicro-US$
New input5030.3150.9
Cached input5,7740.00634.644
Output21.22.4
Charged188 (US$0.000188)

Prices read from the API when this page was built. Current prices: Models and pricing.

  • Requests refused before a lane is called, and requests the model rejects, are not billed.
  • If a lane sends no usage, Worg bills an estimate: the input at the bound used for the cost hold, and one output token per 3 bytes of generated text.
  • Every request appears in the console under Usage with its tokens and cost.

Headers

  • x-request-id on every chat completion response, errors included, except 401 and 413 body_too_large. Send it when you contact support.
  • retry-after, in seconds, on 429 responses. See Retries.

Next: StreamingRate limits