# Agent compatibility

> What an agent needs from a model API, and how Lyber behaves under agent workloads: long tool loops, large contexts and unattended spending.

Source: https://www.lyber.ai/docs/agents/ · Markdown: https://www.lyber.ai/docs/md/agents.md

Lyber speaks OpenAI Chat Completions with function tools, so most agent frameworks and coding agents connect by changing the base URL, the key and the model. The models are abliterated: they don't add refusals of their own, so your agent follows your instructions, and the guardrails it needs are yours to write.

## Coding agents

Each has a setup page with a prompt to copy. The fastest start is [Quick setup](https://www.lyber.ai/docs/agents/quick-setup/).

- [Codex](https://www.lyber.ai/docs/agents/coding-agents/codex/): Both Lyber models in the Codex app or a separate CLI profile. (Guided setup)
- [Hermes](https://www.lyber.ai/connect/): A Hermes agent with its own Lyber profile. (Guided setup)
- [OpenCode](https://www.lyber.ai/docs/agents/coding-agents/opencode/): The open-source terminal agent, through its OpenAI-compatible provider. (Copy a prompt)
- [fx](https://www.lyber.ai/docs/agents/coding-agents/fx/): Vercel's minimal open-source coding agent, through a custom model connection. (Copy a prompt)
- [Crush](https://www.lyber.ai/docs/agents/coding-agents/crush/): Charm's terminal agent, as an OpenAI-compatible provider. (Copy a prompt)
- [Continue](https://www.lyber.ai/docs/agents/coding-agents/continue/): The VS Code and JetBrains assistant, and its `cn` CLI. (Copy a prompt)
- [aider](https://www.lyber.ai/docs/agents/coding-agents/aider/): Pair programming in your terminal, through its OpenAI-compatible mode. (Copy a prompt)
- [Qwen Code](https://www.lyber.ai/docs/agents/coding-agents/qwen-code/): The terminal agent from the Qwen team, in OpenAI-compatible mode. (Copy a prompt)
- [Claude Code](https://www.lyber.ai/docs/agents/coding-agents/claude-code/): Keeps its Claude model; adds a Lyber client to your project. (Adds Lyber to your code)
- [Cursor](https://www.lyber.ai/docs/agents/coding-agents/cursor/): Keeps its own model; adds a Lyber client to your project. (Adds Lyber to your code)

## Agent frameworks

| Framework | How it connects | Guide |
| --- | --- | --- |
| OpenAI Agents SDK | `OpenAIChatCompletionsModel` with a Lyber client | [Build an agent](https://www.lyber.ai/docs/agents/build/) |
| Vercel AI SDK | `@ai-sdk/openai-compatible`, multi-step tools | [Build an agent](https://www.lyber.ai/docs/agents/build/) |
| LangChain and LangGraph | `ChatOpenAI` with a base URL | [LangChain](https://www.lyber.ai/docs/integrations/sdks/langchain/) |
| Any agent with a custom OpenAI-compatible provider | Base URL, key and model ID | [Requirements](#requirements-for-a-custom-provider) |

Claude Code can't use Lyber as its model: it needs the Anthropic Messages API, which Lyber doesn't serve. It can still [add Lyber to your project](https://www.lyber.ai/docs/agents/coding-agents/claude-code/).

## What an agent gets

|   |   |
| --- | --- |
| Context | 1,048,576 tokens on both models |
| Output | Up to 32,768 tokens (MiniMax M3.1 Flash) or 262,144 (DeepSeek V4.1 Flash 1017) per request |
| Tools | OpenAI function tools: up to 32 per request and 32 calls per reply, `tool_choice`, streamed arguments |
| Reasoning | Plain text in `reasoning_content`, which can go back in the history. Effort per request. |
| Formats | Chat Completions, and the [Responses API](https://www.lyber.ai/docs/api/responses/) in preview |
| Identity | The model you name answers, every time. Lyber never swaps in another model. |

## Requirements for a custom provider

An agent that lets you add an OpenAI-compatible provider works with Lyber when it can:

- Point at the base URL `https://lyber-paid-acceptance-gateway-production.up.railway.app/v1` and send the key as a bearer token.
- Use an explicit model ID: `minimax-m3.1-flash-abliterated` or `deepseek-v4.1-flash-1017-abliterated`.
- Leave out the fields Lyber rejects, notably `parallel_tool_calls`, `response_format` (JSON mode and structured outputs), `n`, `seed`, `logprobs` and `user`. They return `400 unsupported_parameter`; see [Compatibility](https://www.lyber.ai/docs/api/compatibility/).
- Take a context window of 1,048,576 tokens and the model's output limit, if it asks for them.
- Turn off automatic retries, or retry only when the model was busy (below).
- Send no more than 32 tools in one request. Agents with many MCP servers can pass that; leave out the servers you don't need.

## One request at a time per model

Each model serves one request at a time and keeps no queue. An agent that fires several model calls at once, such as parallel sub-agents on the same model, gets `429` with `x-lyber-admission: not-admitted` for the extra calls. Those never started and cost nothing: wait the `Retry-After` seconds and resend.

- Make model calls one after another. Run the tools themselves in parallel in your own code if you like.
- Two independent tasks can each use a different model.
- Each account can have 4 requests open and send 60 a minute across both models.

## Unattended spending

- Give each agent its own key with a monthly limit under [Limits](https://www.lyber.ai/dashboard/limits/). A runaway loop stops at the limit with `402 key_spend_limit_exceeded`.
- Cap each step with `max_cost_micro_usdc` and size `max_tokens` to the step. See [Spending controls](https://www.lyber.ai/docs/capabilities/spending-controls/).
- Lyber never retries or deduplicates. After a timeout or a dropped stream, check `GET /v1/credits/requests` before the agent sends the step again.

## Long steps

A request can generate for up to 180 seconds. Stream long steps to show progress, use a lower `reasoning_effort` for routine steps, and keep `max_tokens` to what the step needs.
