Add AI to your application with a single key

An OpenAI-compatible API in front of eight providers. Switch models without touching your code, and track the cost of each feature separately.

Read the docs
  • Works with the OpenAI SDKs
  • Anthropic, OpenAI, Gemini, Mistral and four more
  • Cost per feature, by folder
summarise-ticket.ts
const client = new OpenAI({
  baseURL: "https://api.erha.ai/v1",
  apiKey: process.env.ERHA_API_KEY,
  defaultHeaders: { "X-Erha-Folder": "support.summary" },})

const summary = await client.chat.completions.create({
  model: "ticket-summary",
  messages: [{ role: "user", content: ticket }],
})
200412 tokenssupport.summary0.08 cent

The right model for each feature

Your code calls a profile, which names the provider and model that answer: the most capable where quality matters, the fastest and cheapest everywhere else.

  • OpenAI
  • Anthropic
  • Gemini
  • Mistral AI
  • DeepSeek
  • Grok
  • Groq
  • Kimi

When a new model comes out, change the profile in the console and your calls use it straight away.

Space profiles
Profile calledModelWhy
contract-reviewClaude Opus 4.8Long reasoning, few calls
writingClaude Sonnet 4.6Writing quality
ticket-summaryClaude Haiku 4.5Fast, called often
classificationMistral SmallLowest cost, hosted in Europe

The cost of each feature, with no extra tooling

With the X-Erha-Folder header on your calls, usage for each part of the product is counted separately, under the same key.

A header, or a parameter

X-Erha-Folder: billing, or ?folder=billing. With an OpenAI SDK, declare it once on the client.

Controlled folder names

A key can restrict the allowed folders and make the folder mandatory. A mistyped name is then rejected, with no new line created.

History per folder

Click a folder to see its calls, with model, tokens, cost and duration.

Key “Production”October
FolderCallsTokensCost
billing12,4303.1 M€41.20
support.summary8,2101.9 M€18.75
search2,9401.2 M€14.30
No folder3100.2 M€4.10
Key total23,8906.4 M€78.35

Capped spending, restricted keys

Caps, restrictions and error codes are designed for production use.

Spending caps

On the space, on the API or on a single key. Once the cap is reached, the key returns 402 until the next period.

IP restriction

A leaked key stays unusable outside the authorised servers.

Domain restriction

A key used in a web page cannot be reused from another site.

One key per use

Each key has its own usage and can be revoked immediately.

No provider keys to manage

The Anthropic, OpenAI and Mistral keys stay with ERHA. Your code only uses your ERHA key.

Nothing billed on failure

A call that runs past 280 seconds returns 504 and is not billed.

Your OpenAI code works as is

Change only the client's base URL and key. Everything else follows OpenAI's chat completions format.

OpenAI SDKs

TypeScript, Python, and any OpenAI-compatible client.

Tools

tools, tool_choice and the tool role, as OpenAI defines them.

Images and PDFs

Attached to the message, to have a screenshot or a document read.

Streaming

OpenAI's SSE protocol, for clients that use it.

The whole API is documented

Authentication, routes, folders, attachments, tools, errors, and examples with the SDKs.

  • GET /v1/models
  • POST /v1/chat/completions
Open the docs

Frequently asked questions

Which providers are available?

Anthropic, OpenAI, Google Gemini, Mistral AI, DeepSeek, xAI, Groq and Moonshot, all called with the same ERHA key through your space's profiles.

What is a profile?

A fixed name your code calls, such as ticket-summary or contract-review, which names the provider and model that answer. Switching models happens in the console, with no code change.

How do I track the cost of a feature?

Name a folder in the call, with the X-Erha-Folder header or the folder parameter. The console's API module shows the month's calls, tokens and cost per key and per folder.

How do I avoid a surprise bill?

Set a spending cap on the space, on the API or on a single key. Once the cap is reached, calls are refused until the next period.

How is the API billed?

By usage. Every call is metered and shown with its cost in the console. Usage is first deducted from your plan's AI credit, then billed beyond it, within your caps.

Hand your first task to an agent this week

Create your space in a few minutes, or book a demo to connect a first repository with the ERHA team.