# OpenAI API **Provider:** OpenAI **Category:** ai **Base URL:** `https://api.openai.com/v1` **Auth:** bearer — `Authorization: Bearer sk-proj-...` **Rate Limit:** 3,500 RPM · 200,000 TPM (Tier 1) **Free Tier:** No **Pricing:** Pay per use (pay-as-you-go) **Docs:** https://platform.openai.com/docs ## Description OpenAI provides state-of-the-art AI models via a unified REST API. GPT-4o handles text, vision, and audio; o1 excels at advanced reasoning; DALL·E 3 generates and edits images; Whisper transcribes speech; and embedding models power semantic search and retrieval. ## Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | POST | `https://api.openai.com/v1/chat/completions` | Generate chat completions (GPT-4o, o1, etc.) | | POST | `https://api.openai.com/v1/embeddings` | Create vector embeddings from text | | POST | `https://api.openai.com/v1/images/generations` | Generate images with DALL·E 3 | | POST | `https://api.openai.com/v1/images/edits` | Edit existing images using a mask | | POST | `https://api.openai.com/v1/audio/transcriptions` | Transcribe audio files with Whisper | | POST | `https://api.openai.com/v1/audio/speech` | Convert text to speech (TTS) | | GET | `https://api.openai.com/v1/models` | List all available models | ## Authentication Pass your API key as a Bearer token in the Authorization header. Keys are prefixed with sk-. ``` Authorization: Bearer sk-proj-... ``` ## Sample Request ```bash curl https://api.openai.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "gpt-4o", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Say hello!"} ], "max_tokens": 100 }' ``` ## Sample Response ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "model": "gpt-4o-2024-08-06", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 20, "completion_tokens": 9, "total_tokens": 29 } } ``` ## Pricing Details GPT-4o: $2.50/M input, $10/M output. GPT-4.1: $2/M in, $8/M out. GPT-5: $1.25/M in, $10/M out. o3: $2/M in, $8/M out. o4-mini: $1.10/M in, $4.40/M out. GPT-4o mini: $0.15/M in, $0.60/M out. Batch API: 50% off. --- *Source: [API Map](https://apimap.dev/apis/openai/) — CC BY 4.0*