> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorage.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Call a text model

> Point an OpenAI-compatible client at Anchorage Agentic Banking.

Point an OpenAI-compatible client at Anchorage Agentic Banking.

## Before you start

* An agent whose budget admits the inference provider. The default allow-all budget does.
* An API key for that agent. See [Mint a key](https://docs.anchorage.com/agentic-banking/guides/connect-your-harness.md#mint-a-key).

## Pick a model

Browse the [Inference page](https://agentic.anchorage.com/inference), or list models from `GET /v1/models` with no key. See [How the Inference page shows prices](https://docs.anchorage.com/agentic-banking/concepts/inference.md#how-the-inference-page-shows-prices) for what each entry carries.

## Set up the client

| Setting | Value |
| - | - |
| `base_url` | `https://inference.agentic.anchorage.com/v1` |
| API key | The agent's API key, sent as the bearer token |
| `model` | An identifier from the model list, such as `openai/gpt-4o-mini` |

The Inference page's **How to connect** card walks through these three values with ready-to-paste snippets for curl, Python, and TypeScript. Under the card, **Connect your harness** shows the block to add the endpoint as a custom provider in Hermes or in OpenClaw. The **Agents** page and each agent's page link there with **Set up inference**.

## Send images

Models that accept images take them in the request, the way the provider's own API does. Put an `image_url` part in a message's `content`:

```json theme={null}
{"model": "openai/gpt-4o-mini", "messages": [{"role": "user", "content": [
  {"type": "text", "text": "What does this receipt total?"},
  {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgo..."}}
]}]}
```

* **Size.** Keep a request under about 25 MB, the most the model provider accepts. An image sent inline counts toward it, and base64 encoding makes an image about a third larger than its file, so a request fits about 18 MB of images. Resize or compress the images, or send fewer per request. A request that's too large returns `request_too_large` or `invalid_request` (on `POST /v1/messages`, the error type is `request_too_large` or `invalid_request_error`), and nothing is charged unless the response names a transaction. See [Limits](https://docs.anchorage.com/agentic-banking/reference/limits.md#requests).
* **Inline or by URL.** A base64 data URI (`data:image/png;base64,...`) in an `image_url` part works with every model that reads images. Some providers also accept a public `https` URL in its place and fetch the image themselves, so it doesn't count toward the size limit; check the model's provider before you rely on it.
* **Cost.** An image is billed as input tokens, and one image can cost thousands of them. For example, a 400 KB PNG sent to `openai/gpt-4o-mini` cost about 37,000 input tokens. Downscale an image to the detail the task needs before you send it.

On `POST /v1/messages`, use an `image` content block instead: its `source` carries `"type": "base64"`, the `media_type`, and the base64 `data` without the `data:` prefix. See [Use Claude Code or an Anthropic SDK](https://docs.anchorage.com/agentic-banking/guides/use-claude-code-or-an-anthropic-sdk.md).

## Control repeat requests (optional)

Send an `Idempotency-Key` header to control whether a repeated request shares a charge or pays again. See [Managing idempotency keys](https://docs.anchorage.com/agentic-banking/concepts/inference.md#managing-idempotency-keys).

## Raise your client's timeout

Give your client more than three minutes, so it doesn't give up on a call you already paid for. A streamed response can run for up to 30 minutes, so for a streamed request, set a total timeout above 32 minutes, which leaves room for the payment before the stream starts. If your client limits each wait instead, set the wait for the response headers above 32 minutes too, because a retried payment can delay them, and set each wait for a chunk, the first included, above 10 minutes. A non-streamed request stops if the model hasn't answered 2 minutes after the payment is sent, and a reasoning model can think for longer than that before it answers, so send `"stream": true` for reasoning models and other long calls.

To generate an image or a video instead, see [Generate an image or video](https://docs.anchorage.com/agentic-banking/guides/generate-an-image-or-video.md). For speech, sound effects, or music, see [Generate speech, sound effects, or music](https://docs.anchorage.com/agentic-banking/guides/generate-audio.md). To run Claude Code or an Anthropic SDK, see [Use Claude Code or an Anthropic SDK](https://docs.anchorage.com/agentic-banking/guides/use-claude-code-or-an-anthropic-sdk.md). For a free typed judgment, see [Ask for a typed judgment](https://docs.anchorage.com/agentic-banking/guides/ask-for-a-typed-judgment.md).

See [Paid inference](https://docs.anchorage.com/agentic-banking/concepts/inference.md) for the full flow, and [Errors and retries](https://docs.anchorage.com/agentic-banking/reference/errors-and-retries.md) for the failure modes, including over-budget declines.


## Related topics

- [Overview](https://docs.anchorage.com/agentic-banking/overview.md)
- [Connect a harness with an API key](https://docs.anchorage.com/agentic-banking/guides/connect-your-harness.md)
- [Changelog](https://docs.anchorage.com/agentic-banking/changelog.md)
- [Paid inference](https://docs.anchorage.com/agentic-banking/concepts/inference.md)
- [Generate speech, sound effects, or music](https://docs.anchorage.com/agentic-banking/guides/generate-audio.md)
