# Overview

> INFRO is one control plane over the AI provider accounts you already hold: one API, routing and failover between them, per-request cost, observability and policy.

Source: https://infro.io/docs

> **Note:** INFRO is in private early access. Running these examples requires an early-access account, an active trial or subscription entitlement, and your own provider connection. Self-serve purchasing is not generally open. See [Early access](https://infro.io/early-access).

INFRO sits between your application and the AI providers you already pay. You connect your own provider accounts and call one API; INFRO picks a connection for each request, tries the next one when it fails, records what each request used as your provider reports it, and estimates what your provider will bill you for it. Your providers invoice you directly — INFRO takes 0% of model spend and charges a subscription for the control plane.

Text, image, video, and audio share the same base URL, the same key, the same error model, and the same request extensions. A modality is served only when one of your connections serves it: every connectable provider kind serves text, several serve images or audio, and none of the built-in kinds serves video yet.

```text
https://api.infro.io/v1
```

## What you get

- **One integration across your providers.** Chat completions, image generation and editing, speech synthesis, transcription and video jobs, over whichever of your accounts can serve them — all documented under [Modalities](https://infro.io/docs/modalities/images).
- **0% markup on model spend.** Requests run on the provider accounts you connect, so your providers invoice you directly at whatever you negotiated with them and INFRO takes no part of it. What INFRO charges for is the platform — see [billing](https://infro.io/docs/org/billing).
- **Resilience beyond any one provider.** Health-aware [routing](https://infro.io/docs/features/routing) and [failover](https://infro.io/docs/features/fallbacks) move a request to your next connection or route target when a provider times out or errors before the response starts.
- **Every request, on the record.** Request-level [traces](https://infro.io/docs/observability/traces) carry the model, the connection that served it, the route, latency, and estimated provider cost — grouped by your users and sessions, [exportable](https://infro.io/docs/observability/exports) to your stack.
- **Attribution across every provider.** Estimated provider cost broken down by model, connection, project and key, with per-key spend limits and request-level export — see [Rate & spend limits](https://infro.io/docs/api/limits).
- **Governance built in.** [Members and roles](https://infro.io/docs/org/members), [spend ceilings](https://infro.io/docs/org/spend-controls), [model allowlists](https://infro.io/docs/org/model-allowlists), and an [audit log](https://infro.io/docs/org/audit-log) — one account the whole company can use.

## The endpoints

| Modality | Endpoint | Shape | Metered per |
| --- | --- | --- | --- |
| Text | `POST /v1/chat/completions` | Synchronous or streaming | Token |
| Image | `POST /v1/images/generations`, `POST /v1/images/edits` | Synchronous | Image |
| Video | `POST /v1/videos` | Async job + webhook | Second of output |
| Speech | `POST /v1/audio/speech` | Synchronous or streaming | Character |
| Transcription | `POST /v1/audio/transcriptions` | Synchronous | Hour of audio |

## How a request flows

1. Your app calls an endpoint with an INFRO API key and a model id like `bfl/flux-2-pro`, or the slug of a [route](https://infro.io/docs/routes).
2. INFRO validates the key, applies its rate limit and checks the organization has an active trial or plan.
3. INFRO resolves the model to the targets of a named [route](https://infro.io/docs/routes), or to the provider connections you have added for that vendor, checks your [budgets](https://infro.io/docs/org/spend-controls) against the request's worst-case cost, and forwards it to the first eligible connection in its native format.
4. If an attempt times out or fails before the response begins, INFRO tries the next target or connection — and, on a request that names a model rather than a route, can fall back to another model if you configured [fallbacks](https://infro.io/docs/features/fallbacks). Once a response has started streaming, a drop surfaces as an error your client retries.
5. Long-running work (video, large batches) becomes an [async job](https://infro.io/docs/api/jobs) you receive by [webhook](https://infro.io/docs/api/webhooks).
6. Usage is metered per unit and appears in your dashboard and export within seconds. Every response carries `usage.cost`, the estimated provider cost — `null` when the model is unpriced.

> **Note:** Routing is designed against an overhead target of under 40ms — a target, not a measured figure, since the gateway has no production history yet. Against generation time that is noise, but measure on your own traffic if you stream audio or otherwise care about time-to-first-byte.

## A complete request

**Python**

```python
import os
from infro import Infro

client = Infro(api_key=os.environ["INFRO_API_KEY"])

# The Python SDK returns plain dicts.
image = client.images.generate(
    model="bfl/flux-2-pro",
    prompt="studio product shot, soft rim light",
)
print(image["data"][0]["url"], image["usage"].get("cost"))
```

**TypeScript**

```typescript
import Infro from "@infro.io/sdk";

const infro = new Infro({ apiKey: process.env.INFRO_API_KEY });

const image = await infro.images.generate({
  model: "bfl/flux-2-pro",
  prompt: "studio product shot, soft rim light",
});
console.log(image.data[0].url, image.usage?.cost);
```

**curl**

```bash
curl https://api.infro.io/v1/images/generations \
  -H "Authorization: Bearer $INFRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bfl/flux-2-pro",
    "prompt": "studio product shot, soft rim light",
    "n": 1,
    "size": "1024x1024"
  }'
```

Text requests keep the OpenAI-compatible shape, so an existing OpenAI integration only needs a new base URL and key — see [Chat completions](https://infro.io/docs/api/chat-completions).

## Where to go next

- [Quickstart](https://infro.io/docs/quickstart) — key to first response in five minutes.
- [Image generation](https://infro.io/docs/modalities/images), [Video generation](https://infro.io/docs/modalities/video), and [Audio & speech](https://infro.io/docs/modalities/audio) — the per-modality references.
- [Routing](https://infro.io/docs/features/routing) — customer-owned connections, priority or weighted targets, and failover.
- [Privacy & data](https://infro.io/docs/privacy) — what we store, what we never store, and optional prompt capture (off by default).
