# API overview (https://hypit.ai/api-reference/)

> One OpenAI-shaped API in front of two dozen generative-media vendors, billed in credits.

hypit.ai exposes a single HTTP API that fans out across roughly two dozen upstream image, video,
audio and chat vendors. You hold one key, one balance and one wire format; routing, failover and
metering happen on our side.

The surface is deliberately **OpenAI-shaped**. `/v1/chat/completions` and `/v1/models` are drop-in
compatible with the official OpenAI SDKs — point the client at our base URL and existing code keeps
working. The generative-media endpoints borrow the same conventions (snake\_case JSON, an
`{"error": {...}}` envelope, Unix-second timestamps) but return a **job** rather than a finished
artifact, because a video does not come back inside an HTTP request.

## Base URL [#base-url]

```text
https://hypit.ai/v1
```

The native Google surface lives one level up, at `https://hypit.ai/v1beta/models/...` — see
[Gemini native](/api-reference/gemini).

## Environment variables [#environment-variables]

Two variables carry everything a client needs:

```bash
export HYPIT_API_KEY="sk-hh-..."
export HYPIT_BASE_URL="https://hypit.ai/v1"
```

We use `HYPIT_*` rather than `OPENAI_*` on purpose: these are our credentials, and a project that
already talks to OpenAI should be able to keep both configured side by side. The cost is one
explicit line when you construct the client — which is clearer anyway, because it says out loud
where the client is pointed.

## Using the OpenAI SDKs [#using-the-openai-sdks]

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["HYPIT_API_KEY"],
    base_url=os.environ.get("HYPIT_BASE_URL", "https://hypit.ai/v1"),
)

completion = client.chat.completions.create(
    model="gemini-3.1-pro",
    messages=[{"role": "user", "content": "In one sentence: what is Hypit?"}],
)
print(completion.choices[0].message.content)
```

```js
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.HYPIT_API_KEY,
  baseURL: process.env.HYPIT_BASE_URL ?? "https://hypit.ai/v1",
});

const completion = await client.chat.completions.create({
  model: "gemini-3.1-pro",
  messages: [{ role: "user", content: "In one sentence: what is Hypit?" }],
});
console.log(completion.choices[0].message.content);
```

<Callout type="warn" title="The SDK helpers only cover the synchronous endpoints">
  `client.chat.completions.*`, `client.models.*`, `client.audio.speech.*` and
  `client.audio.transcriptions.*` work unchanged. `client.images.generate()` does **not**: our image,
  video and music endpoints answer `202 Accepted` with a job envelope, not with a finished `data[]`
  array. Call those over plain HTTP and poll — every page below shows how.
</Callout>

## Your first call [#your-first-call]

```bash
curl https://hypit.ai/v1/models \
  -H "Authorization: Bearer $HYPIT_API_KEY"
```

If that returns a list, everything else on this site will work.

## The surface [#the-surface]

| Endpoint                          | Method | Shape                                     |
| --------------------------------- | ------ | ----------------------------------------- |
| `/v1/models`                      | GET    | list every model your key can route to    |
| `/v1/models/{model}`              | GET    | one model card, including its credit rate |
| `/v1/chat/completions`            | POST   | synchronous, streams over SSE             |
| `/v1/images/generations`          | POST   | asynchronous — returns a job              |
| `/v1/images/edits`                | POST   | asynchronous — returns a job              |
| `/v1/videos`                      | POST   | asynchronous — returns a job              |
| `/v1/audio/music`                 | POST   | asynchronous — returns a job              |
| `/v1/audio/speech`                | POST   | synchronous, returns audio bytes          |
| `/v1/audio/transcriptions`        | POST   | synchronous, returns text                 |
| `/v1/jobs/{job_id}`               | GET    | job status                                |
| `/v1/jobs/{job_id}/assets`        | GET    | signed download links                     |
| `/v1beta/models/{model}:{action}` | POST   | native Google Gemini passthrough          |

Read [Authentication](/api-reference/authentication) next, then
[Asynchronous jobs](/api-reference/jobs) if you plan to generate anything visual — that page is
where the surprises live.