# OpenAI — Orthogonal API

> Pay-per-use API on Orthogonal. Each call is billed to your Orthogonal balance.
> Base API: `https://api.orth.sh/v1/run` · [llms.txt](https://orthogonal.com/llms.txt) · [browse all APIs](https://orthogonal.com/discover)

OpenAI API for text generation, embeddings, image generation, audio processing, and content moderation.

**Verified:** no

## Access

**Run API:** `POST https://api.orth.sh/v1/run`
**Auth:** `Authorization: Bearer $ORTHOGONAL_API_KEY`
Get an API key at https://orthogonal.com/dashboard/settings/api-keys

Every call goes through the unified Run API: send the API `slug`, the endpoint `path`, and the `query`/`body` parameters. The response is `{ "success": true, "price": "<usd>", "data": { ... } }`.

## Endpoints

### List Models

Lists all currently available models with basic information.

`GET /models`

**Estimated cost:** $0

_No parameters required._

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/models","method":"GET"}'
```

### Retrieve Model

Retrieves details about a specific model.

`GET /models/{model}`

**Estimated cost:** $0

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Path parameter — substitute directly into the endpoint `path`. |

```bash
# Replace {model} in "path" with real values before sending
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/models/{model}","method":"GET"}'
```

### Create Moderation

Classifies if text and/or image inputs are potentially harmful.

`POST /moderations`

**Estimated cost:** $0

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `input` | string | Yes | Input to classify. String, array of strings, or multi-modal objects. |
| `model` | string | No | Model: omni-moderation-latest, text-moderation-latest. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/moderations","body":{"input":"<string>","model":"<string>"}}'
```

### Create Embeddings

Creates embedding vectors for input text. Useful for search, clustering, and classification.

`POST /embeddings`

**Estimated cost:** $0.003

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `input` | string | Yes | Text to embed. String, array of strings, or token arrays. Max 8192 tokens. |
| `model` | string | Yes | Model ID (text-embedding-3-small, text-embedding-3-large) |
| `encoding_format` | string | No | float or base64. |
| `dimensions` | number | No | Output dimensions (text-embedding-3 only). |
| `user` | string | No | End-user identifier. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/embeddings","body":{"input":"<string>","model":"<string>","encoding_format":"<string>","dimensions":"<number>","user":"<string>"}}'
```

### Create Transcription

Transcribes audio into text in the input language.

`POST /audio/transcriptions`

**Estimated cost:** $0.02

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `file` | string | Yes | Audio file (multipart). Formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. |
| `model` | string | Yes | Model: whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe. |
| `language` | string | No | Language in ISO-639-1 format. |
| `prompt` | string | No | Guide the transcription style. |
| `response_format` | string | No | Output: json, text, srt, verbose_json, vtt. |
| `temperature` | number | No | Temperature 0-1. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/audio/transcriptions","body":{"file":"<string>","model":"<string>","language":"<string>","prompt":"<string>","response_format":"<string>","temperature":"<number>"}}'
```

### Create Translation

Translates audio into English text.

`POST /audio/translations`

**Estimated cost:** $0.02

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `file` | string | Yes | Audio file (multipart). |
| `model` | string | Yes | Model: whisper-1. |
| `prompt` | string | No | Guide the translation style. |
| `response_format` | string | No | Output format. |
| `temperature` | number | No | Temperature 0-1. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/audio/translations","body":{"file":"<string>","model":"<string>","prompt":"<string>","response_format":"<string>","temperature":"<number>"}}'
```

### Generate Image

Creates images from a text prompt using GPT Image or DALL-E models.

`POST /images/generations`

**Estimated cost:** $0.08

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `prompt` | string | Yes | Text description of the desired image. |
| `model` | string | No | Model (gpt-image-1, dall-e-3, dall-e-2). |
| `n` | number | No | Number of images to generate. |
| `size` | string | No | Image size (1024x1024, 1536x1024, etc). |
| `quality` | string | No | Quality: low, medium, high, auto. |
| `background` | string | No | Background: transparent, opaque, auto. |
| `response_format` | string | No | url or b64_json. |
| `user` | string | No | End-user identifier. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/images/generations","body":{"prompt":"<string>","model":"<string>","n":"<number>","size":"<string>","quality":"<string>","background":"<string>","response_format":"<string>","user":"<string>"}}'
```

### Create Chat Completion

Creates a model response for the given chat conversation. Supports text, vision, and audio inputs.

`POST /chat/completions`

**Estimated cost:** $0.03

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Model ID (e.g. gpt-4o, gpt-4o-mini, o3, o4-mini) |
| `messages` | array | Yes | Messages comprising the conversation. Each has role (system/user/assistant) and content. |
| `temperature` | number | No | Sampling temperature 0-2. Defaults to 1. |
| `max_tokens` | number | No | Maximum tokens to generate. |
| `top_p` | number | No | Nucleus sampling. Defaults to 1. |
| `n` | number | No | Number of completions. Defaults to 1. |
| `stream` | boolean | No | Stream partial deltas. |
| `stop` | string | No | Stop sequences. |
| `tools` | array | No | Tools the model may call. |
| `tool_choice` | string | No | Tool selection: auto, none, required. |
| `response_format` | object | No | Response format config. |
| `frequency_penalty` | number | No | Frequency penalty -2.0 to 2.0. |
| `presence_penalty` | number | No | Presence penalty -2.0 to 2.0. |
| `seed` | number | No | Seed for deterministic sampling. |
| `user` | string | No | End-user identifier. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/chat/completions","body":{"model":"<string>","messages":"<array>","temperature":"<number>","max_tokens":"<number>","top_p":"<number>","n":"<number>","stream":"<boolean>","stop":"<string>","tools":"<array>","tool_choice":"<string>","response_format":"<object>","frequency_penalty":"<number>","presence_penalty":"<number>","seed":"<number>","user":"<string>"}}'
```

### Create Response

Creates a model response via the Responses API with built-in tools like web search and file search.

`POST /responses`

**Estimated cost:** $0.03

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Model ID (e.g. gpt-4o, o3, o4-mini) |
| `input` | string | Yes | Text, image, or file inputs. String or array of input items. |
| `instructions` | string | No | System instructions. |
| `temperature` | number | No | Sampling temperature 0-2. |
| `max_output_tokens` | number | No | Max output tokens. |
| `tools` | array | No | Tools: web_search, file_search, functions, etc. |
| `text` | object | No | Text response format config. |
| `stream` | boolean | No | Stream response events. |
| `user` | string | No | End-user identifier. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/responses","body":{"model":"<string>","input":"<string>","instructions":"<string>","temperature":"<number>","max_output_tokens":"<number>","tools":"<array>","text":"<object>","stream":"<boolean>","user":"<string>"}}'
```

### Count Input Tokens

Returns input token counts for a request without generating a response.

`POST /responses/input_tokens`

**Estimated cost:** $0

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Model ID to count tokens for. |
| `input` | string | No | Input to count tokens for. |
| `instructions` | string | No | System instructions. |
| `tools` | array | No | Tools to include in count. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/responses/input_tokens","body":{"model":"<string>","input":"<string>","instructions":"<string>","tools":"<array>"}}'
```

### Create Speech

Generates audio speech from input text (TTS).

`POST /audio/speech`

**Estimated cost:** $0.02

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `input` | string | Yes | Text to generate audio for. Max 4096 chars. |
| `model` | string | Yes | TTS model: tts-1, tts-1-hd, gpt-4o-mini-tts. |
| `voice` | string | Yes | Voice: alloy, ash, coral, echo, fable, onyx, nova, sage, shimmer. |
| `response_format` | string | No | Audio format: mp3, opus, aac, flac, wav, pcm. |
| `speed` | number | No | Speed 0.25-4.0. Defaults to 1.0. |
| `instructions` | string | No | Voice style instructions (gpt-4o-mini-tts only). |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/audio/speech","body":{"input":"<string>","model":"<string>","voice":"<string>","response_format":"<string>","speed":"<number>","instructions":"<string>"}}'
```

### Edit Image

Creates an edited or extended image from source images and a prompt.

`POST /images/edits`

**Estimated cost:** $0.08

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `prompt` | string | Yes | Text description of the desired edit. |
| `image` | string | No | Source image as a file upload (_file object with data, filename, contentType). |
| `model` | string | No | Model (gpt-image-1, dall-e-2). |
| `n` | number | No | Number of images. |
| `size` | string | No | Image size. |
| `quality` | string | No | Image quality. |
| `user` | string | No | End-user identifier. |

```bash
curl -X POST 'https://api.orth.sh/v1/run' \
  -H 'Authorization: Bearer $ORTHOGONAL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"api":"openai","path":"/images/edits","body":{"prompt":"<string>","image":"<string>","model":"<string>","n":"<number>","size":"<string>","quality":"<string>","user":"<string>"}}'
```

---

Full details and an interactive quickstart: https://orthogonal.com/discover/openai
