For a text-generation integration, OpenAI’s model catalog lists GPT-6 Astra (gpt-6-astra) for complex reasoning and coding, GPT-6.1 Sol (gpt-6.1-sol) to balance intelligence and cost, and GPT-6 Luna (gpt-6-luna) for cost-sensitive, high-volume workloads. The catalog says these models are available through the Responses API and OpenAI client SDKs. Check that your API project can use the model you choose before relying on it in an integration. (OpenAI model catalog)
For a first text request, use the official Python SDK and Responses API example below. Set your API key in the environment rather than writing it into application source code. Recheck the official catalog when you build or update your integration.
Which GPT API model should you choose?
| Use case | Model to evaluate first | Catalog positioning |
|---|---|---|
| Complex reasoning, coding, or other demanding work | GPT-6 Astra (gpt-6-astra) |
OpenAI’s flagship model for complex reasoning and coding; described as its most capable model for demanding work. |
| Complex work where cost also matters | GPT-6.1 Sol (gpt-6.1-sol) |
Described as near-Astra performance for complex work at a lower cost. |
| Focused, high-volume tasks with cost sensitivity | GPT-6 Luna (gpt-6-luna) |
Described as OpenAI’s most efficient model for focused, high-volume tasks. |
These are starting points from OpenAI’s catalog, not a guarantee that one model will be best for a particular application. Test representative inputs and outputs for your task before selecting a default. The catalog also lists GPT-6.1 Terra (gpt-6.1-terra) as a fast, efficient model for visual reasoning, precise computer use, and clear, natural writing. (OpenAI model catalog)
For image generation or editing: distinguish a specialized image-generation model from a text model that can accept image input. Check OpenAI’s current model and image-generation documentation for the applicable model ID and API path; don’t infer API compatibility from a third-party listing or capability label alone. (OpenAI model catalog · Image-generation guide)
Make a first GPT API request with Python
This example uses gpt-6.1-sol with the Responses API. It assumes Python 3.10 or later and the official OpenAI Python SDK. The SDK reference identifies Responses as the primary API for interacting with OpenAI models and demonstrates reading generated text from response.output_text. (Python SDK reference)
-
Install the SDK:
python -m pip install openai -
Set
OPENAI_API_KEYin your shell. On macOS or Linux:export OPENAI_API_KEY="your_api_key_here"Use your operating system’s environment-variable method on Windows. Keep the key out of source control and do not expose it in browser-side code.
-
Save and run this Python script:
from openai import OpenAI client = OpenAI() response = client.responses.create( model="gpt-6.1-sol", input="Give me three concise ideas for a thank-you email subject line.", ) print(response.output_text)
The SDK reads the key from the environment, sends the model ID and input to client.responses.create, and exposes the generated text as response.output_text. To try another model in the comparison, change the model value to its documented ID and confirm that your API project can use it. (Python SDK reference · OpenAI model catalog)
Checks before production
- Confirm the model ID and API path. Recheck the official model entry and applicable API reference before deployment or a model change. Confirm the chosen model is available to your API project. (OpenAI model catalog)
- Check project limits against your workload. OpenAI documents limits such as requests per minute and tokens per minute; limits vary by model and are defined at organization and project level. Review the current limits for the project that will make the requests rather than relying on a generic number. (Rate limits guide)
- Plan for rate-limit responses. If request volume exceeds the applicable limit, consult OpenAI’s rate-limit guidance and handle the resulting errors in your application. The limit that matters can depend on request count, token volume, or another documented metric. (Rate limits guide)
- Recheck model information when upgrading. Follow the current official catalog and any model-specific lifecycle notice before switching IDs. (OpenAI model catalog)
Official references
Start with the OpenAI API models catalog for model choices and IDs, the Python SDK reference for the request pattern, and the rate limits guide for project-specific constraints.
