Quickstart
This guide will get you all set up and ready to use the OpenAI API. We'll walk you through setting up an API client and making your first API request. This will give you a quick overview of how to begin integrating powerful AI capabilities into your applications.
Before you can make requests to the API, you will need to obtain your API key from your dashboard. Find it under API Keys.
Choose your client
Before making your first API request, decide which API client to use. Alongside direct cURL HTTP requests, OpenAI provides client libraries for JavaScript, Python, and more. Here's how to install each client:
# cURL might already be installed on your machine
curl --version
Making your first API request
After selecting your preferred client, you're ready to make your first API call to the OpenAI service. Below, see how to send a POST request to create a new GPT-3 completion. In the cURL example, we demonstrate how to ask the model to generate a simple text response.
curl https://api.model.box/v1/chat/completions \
-H "Authorization: Bearer {your_api_key}" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{
"role": "user",
"content": "Say this is a test!"
}]
}'
What's next?
Congratulations! You're now set up with an API client and have made your first request. Here are some useful links as you dive deeper into using the OpenAI API:
- Get your API key from the ModelBox dashboard
- Learn about the different AI models available
- Understand the API rate limits and guidelines
Feel free to adapt this to better fit your application's specific needs or let me know if there's anything else you'd like to include!