OpenAI Docs

OpenAI Docs — User Guide

OpenAI API docs.

Visit website VPN may be required Free
Strengths
  • OpenAI official authoritative document
  • API covering all OpenAI products
  • Contains code samples and playground
  • Regularly updated to reflect the latest features
  • Provide API Reference and usage guide
Best for
  • Learn how to call the OpenAI API
  • Understand the capabilities and limitations of each model
  • Find API parameters and return formats
  • Learn advanced features like Function Calling, Assistants, and more
  • Learn about pricing and usage restrictions

Document structure navigation

The OpenAI document structure is clear, and you can quickly find the information you need by mastering the navigation method.

Scenario

Quick start guide

Prompt example
Main parts of the document:

1. Quickstart
   - Install SDK
   - First API call
   - Introduction to basic concepts

2. Guides
   - Text generation
   - Vision (image understanding)
   - Function calling
   - Assistants (AI assistants)
   - Fine-tuning (model fine-tuning)

3. API Reference
   - Complete parameter descriptions for all endpoints
   - Request and response formats

4. Cookbook (code example)
   -Code examples of actual application scenarios
   - cookbook.openai.com
Output / what to expect

Through the document structure,

Find the information you need quickly,

Cookbooks are the best material for learning practical applications.

Tips

When you encounter a specific problem, check the Cookbook first, which usually has ready-made code examples.

Scenario

Test using playground

Prompt example
OpenAI Playground (platform.openai.com/playground):




Function:


1. Test API calls online without writing code


2. Adjust parameters (temperature, max_tokens, etc.)


3. View the code of the API request (Python/Node.js/curl)


4. Test the effect of System Prompt




Usage scenarios:


- Test Prompt effect


- Understand the impact of parameters on output


- Rapid prototyping
Output / what to expect

Playgrounds are the fastest way to test your API.

You can see the effect immediately after adjusting the parameters.

The generated code can be copied directly.

Tips

After debugging the prompt and parameters in the playground, copy the code to the project, which is more efficient.

Key API features

Some of the most important features of the OpenAI API.

Scenario

Chat Completions API

Prompt example
Most commonly used API endpoints:

POST https://api.openai.com/v1/chat/completions

Key parameters:
- model: model name (gpt-4o, gpt-4o-mini, etc.)
- messages: conversation history
- temperature: creativity (0-2, default 1)
- max_tokens: maximum output length
- stream: whether to stream output
- response_format: output format (JSON mode)

Python example:
```python
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
    temperature=0.7,
    max_tokens=1000
)
```
Output / what to expect

Chat Completions is the core API.

Mastering this API can complete 90% of AI application requirements.

Tips

temperature=0 makes the output more deterministic, suitable for tasks that require consistency; temperature=1 is more creative.

Compared with similar tools

ToolStrengthBest forPricing
OpenAI Docs This toolOfficial authority, the latest and most complete, Playground is convenient for testingOpenAI API developer, learn API usagecompletely free
Anthropic DocsClaude API documentationUsing Claude APIcompletely free
Google AI DocsGemini API documentationUsing Gemini APIcompletely free
OpenAI CookbookPractical application code examplesLearn the implementation of specific application scenarioscompletely free

Sources & references: