O

OpenAI API

by OpenAI

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.

gpt-4oo1visionembeddingsimagesaudio

Quick Reference

Base URL https://api.openai.com/v1 Auth type Bearer Token Auth header Authorization: Bearer sk-proj-... Rate limit 3,500 RPM · 200,000 TPM (Tier 1) Pricing Pay per use Free quota $5 free credit for new accounts Documentation https://platform.openai.com/docs Endpoint status Server online — HTTP 404 — server is online but path returned an error (may require auth)117ms (checked Mar 29, 2026) Builder score B 72% builder-friendly
Pricing
75
Latency
50
Depth
86

Authentication

Pass your API key as a Bearer token in the Authorization header. Keys are prefixed with sk-.

Authorization: Bearer sk-proj-...

Pricing

Model pay-as-you-go Starting price Pay per use Free quota $5 free credit for new accounts Unit cost $2.5000 per 1,000,000 input tokens (GPT-4o)
PlanPrice/moIncluded
PAYG Free No minimum, pay per token
Plus ($20) $20 $20/mo for ChatGPT Plus (not API)

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.

Key Endpoints

MethodPathDescription
POST /chat/completions Generate chat completions (GPT-4o, o1, etc.)
POST /embeddings Create vector embeddings from text
POST /images/generations Generate images with DALL·E 3
POST /images/edits Edit existing images using a mask
POST /audio/transcriptions Transcribe audio files with Whisper
POST /audio/speech Convert text to speech (TTS)
GET /models List all available models

Sample Request

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

{
  "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
  }
}

Data sourced from API Map. Always verify pricing and rate limits against the official OpenAI documentation.