OpenAI API
OpenAI 接口
Access GPT-4o, GPT-4, GPT-3.5, embeddings, DALL-E, Whisper, and TTS models via REST API.
通过 REST API 调用 GPT-4o、GPT-4、GPT-3.5、Embeddings、DALL-E、Whisper 和 TTS 模型。
Website
Documentation
Pricing
pay-as-you-go (per token)
Authentication
- API Key (Bearer Token)
Rate Limit
10000 req/min (varies by tier)
Typical Latency
<500ms (GPT-4o)
Max Context
128K (GPT-4o)
Popularity
100/100
Endpoints
https://api.openai.com/v1/chat/completions
https://api.openai.com/v1/embeddings
https://api.openai.com/v1/images/generations
https://api.openai.com/v1/audio/transcriptions
SDKs
PythonNode.jsGoJavacurl
Key Features
- ◆GPT-4o, GPT-4, GPT-3.5 model family
- ◆Multimodal: vision, audio, text generation
- ◆Function calling & structured outputs
- ◆Embeddings API for semantic search
- ◆Fine-tuning for custom models
Usage Tips
- 💡Use gpt-4o for complex reasoning, gpt-4o-mini for simple tasks to save cost
- 💡Set max_tokens to control response length and cost
- 💡Use streaming for real-time chat experiences
- 💡Store API keys in environment variables, never in code
SPONSORED
This API listing is sponsored. Content is independently maintained.
Code Examples
Chat Completionbash
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": "user", "content": "Hello!"}]
}'Python: Chat Completionpython
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Tags
llmchatembeddingsvisionaudio
Last updated: 2026-07-27
Similar APIs
ElevenLabs Text-to-Speech API
★93Ultra-realistic AI voice generation. 29+ languages, voice cloning, and streaming TTS.
ElevenLabs API
★93Ultra-realistic AI text-to-speech. 29 languages, voice cloning, and streaming TTS.
LangChain Platform
★91Framework and platform for building LLM applications. LangSmith for observability, LangServe for deployment.
Anthropic Claude API
★87Access Claude 3.5 Sonnet, Haiku, and Opus models for chat, analysis, and code generation.
Something wrong or missing? Open an issue on GitHub →
Pricing Comparison
| API | Pricing | Auth | Popularity |
|---|---|---|---|
| Anthropic Claude API | pay-as-you-go (per token) | API Key (x-api-key header) | 87 |
| Google Gemini API | free tier available, pay-as-you-go | API Key | 85 |
| OpenAI Assistants API | pay-as-you-go (per token + per tool use) | API Key (Bearer Token) | 84 |
| DeepSeek API | pay-as-you-go (per token, very low cost) | API Key | 83 |
Discussion
Questions, feedback, or suggestions? Start a discussion.
Discuss on GitHub