# Ember

> One model call, priced per token, at three grades — with the routing, compression and caching that make the cheap grade cheap.

Source: https://cloud.gomry.com/services/inference

Ember is one call to a language model, on your Gomry key. You choose a CAPABILITY rather than a model — `cheap`, `balanced` or `strong` — and we decide which model serves it. That indirection is the product: the day a smaller specialist beats the current cheap model at a fraction of the cost, your call gets cheaper and your code does not change.

## Overview

Billing is per token, in six rows: input and output at each of the three capabilities. Output costs several times input on every model worth using, and the strong grade costs several times the cheap one, so a single blended token price would be wrong in both directions at once. The `usage` field in each response is exactly what went on your invoice.

It is cheap because of what it does not send. Passage selection scores a long input against what you actually asked for and drops the rest; a thinking budget stops a trivial call from billing eight times its visible answer at the output rate; an exact-result cache answers a repeated call without a vendor round trip. Each of those is measured before it is turned on, and none of them changes what you are charged — the savings are ours to earn, which is why the price is per token submitted rather than per cent we spent.

Everything is priced at the model's published rate, computed from tokens on our side rather than read back from the vendor, so what we charge you and what the envelope allows can never disagree with each other. A call that fails after the model ran still consumed tokens and is still billed for them; a call that never reached a vendor costs nothing.

What it does not do: there are no tools, no function calling and no multi-turn conversation state — one system prompt, one user message, one answer. That is a deliberate containment boundary, not a roadmap gap: the inputs here are frequently scraped pages, and a model that reads untrusted text and can also act on it is a different risk product. It does not stream, and it does not let you name a model directly — if you need a specific model id, you want that vendor, not us.

## Endpoints

**POST /v1/inference** — One model call, priced per token, at three grades — with the routing, compression and caching that make the cheap grade cheap.

```bash
curl -X POST https://api.cloud.gomry.com/v1/inference \
  -H "Authorization: Bearer $GOMRY_CLOUD_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "capability": "cheap",
    "system": "You extract structured data. Answer with one JSON object.",
    "user": "Event page text here. Return the name and start date.",
    "jsonSchema": { "type": "object", "properties": {
      "name": { "type": "string" }, "startDate": { "type": "string" } } }
  }'
```

The response reports `usage` — the quantity you were metered for this call.

## Request options

- `capability` — Required. cheap | balanced | strong. Chooses the price/quality grade, never a specific model.
- `system` — Required. 1–20000 characters of instruction. Treat it as yours: nothing is prepended.
- `user` — Required. 1–400000 characters. The content to work on. Long inputs are trimmed to the model's window, head first.
- `jsonSchema` — A JSON Schema object. Sent as a constrained-decoding hint where the vendor supports it; always parse defensively, because some ignore it.
- `maxOutputTokens` — Caps the answer. 1–16384, and never raised above the capability's own ceiling. Remember that thinking tokens count against it.
- `effort` — minimal | low | default. Lowers the thinking budget on a call that does not need to reason. Ignored by vendors that do not support it.
- `timeoutMs` — Milliseconds before the vendor call is abandoned. Can only tighten the capability's own timeout, never extend it.
- `noCache` — Skip the result cache for this call. Default false. A cache hit bills the same as a live call — it is our cost that changed, not your result.

## Pricing

| Unit | Price |
| --- | --- |
| per input token (cheap) | 0.00011¢ ($1.10 per 1M) |
| per output token (cheap) | 0.0009¢ ($9.00 per 1M) |
| per input token (balanced) | 0.00055¢ ($5.50 per 1M) |
| per output token (balanced) | 0.0028¢ ($28.00 per 1M) |
| per input token (strong) | 0.00055¢ ($5.50 per 1M) |
| per output token (strong) | 0.0028¢ ($28.00 per 1M) |

Only calls that returned a result are billed. Failures cost nothing. Billed monthly in arrears — see [Billing](https://cloud.gomry.com/docs/billing).

## Authentication

Send a key as a bearer token. This service's operations require the `inference:run` scope, granted independently — and the project must have Ember enabled. See [Authentication](https://cloud.gomry.com/docs/authentication).
