Configure existing OpenAI SDK clients to use GPT models on RunAPI.
Model Reference · Skill Repo · All Models
Call the GPT API and OpenAI text embeddings through RunAPI with the official
OpenAI SDK -- point any OpenAI-compatible client at https://runapi.ai/v1,
send gpt-5.2, gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-5.3-codex, or
text-embedding-3-small, and pay through one RunAPI balance. This skill
teaches Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents how to wire the
OpenAI SDK up to the GPT API on RunAPI.
The canonical agent file is skills/gpt/SKILL.md.
npx skills add runapi-ai/gpt -gOr paste this prompt to your AI agent:
Install the gpt skill for me:
1. Clone https://github.com/runapi-ai/gpt
2. Copy the skills/gpt/ directory into your
user-level skills directory (e.g. ~/.claude/skills/
for Claude Code, ~/.codex/skills/ for Codex).
3. Verify that SKILL.md is present.
4. Confirm the install path when done.
The GPT API on RunAPI speaks the standard OpenAI protocol: Chat Completions
(POST /v1/chat/completions), the Responses API (POST /v1/responses), and
Embeddings (POST /v1/embeddings). The official OpenAI SDK works unchanged
once base_url points at https://runapi.ai/v1 and api_key is set to a
RunAPI API Key.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_RUNAPI_TOKEN",
base_url="https://runapi.ai/v1",
)
response = client.chat.completions.create(
model="gpt-5.4",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_RUNAPI_TOKEN",
baseURL: "https://runapi.ai/v1",
});
const response = await client.chat.completions.create({
model: "gpt-5.4",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);curl -X POST "https://runapi.ai/v1/chat/completions" \
-H "x-api-key: YOUR_RUNAPI_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"messages": [{"role": "user", "content": "Hello!"}]
}'Get a RunAPI API Key at https://runapi.ai/api_keys.
response = client.embeddings.create(
model="text-embedding-3-small",
input=["search document", "query text"],
encoding_format="float",
)
print(response.data[0].embedding)const response = await client.embeddings.create({
model: "text-embedding-3-small",
input: ["search document", "query text"],
encoding_format: "float",
});
console.log(response.data[0].embedding);GPT generation models can also be called from Anthropic-compatible
/v1/messages clients and Gemini contents clients on RunAPI. Use those paths
when an existing agent runtime already expects that request shape; for new GPT
app code, prefer the OpenAI-compatible setup above.
curl -X POST "https://runapi.ai/v1/messages" \
-H "x-api-key: YOUR_RUNAPI_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'curl -X POST \
"https://runapi.ai/v1beta/models/gpt-5.4:streamGenerateContent" \
-H "x-goog-api-key: YOUR_RUNAPI_TOKEN" \
-H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"Hello!"}]}]}'Embeddings remain available only on /v1/embeddings.
export OPENAI_BASE_URL=https://runapi.ai/v1
export OPENAI_API_KEY=YOUR_RUNAPI_TOKEN
codex| Model ID | API | Notes |
|---|---|---|
gpt-5.5 |
Chat Completions, Responses | Latest general model |
gpt-5.5-pro |
Responses only | Reasoning-heavy |
gpt-5.4 |
Chat Completions, Responses | Production default |
gpt-5.4-mini |
Chat Completions, Responses | Cost-optimized |
gpt-5.4-nano |
Chat Completions, Responses | Smallest, fastest |
gpt-5.4-pro |
Responses only | Reasoning |
gpt-5.3-codex |
Chat Completions, Responses | Code generation |
gpt-5.3-codex-spark |
Chat Completions, Responses | Faster Codex variant |
gpt-5.2 |
Chat Completions, Responses | Cost-effective |
gpt-5.2-pro |
Responses only | Reasoning |
text-embedding-3-large |
Embeddings | High-capacity vectors |
text-embedding-3-small |
Embeddings | Efficient vectors |
text-embedding-ada-002 |
Embeddings | Legacy-compatible vectors |
Pro models (gpt-5.*-pro) only support the Responses API. Embedding models
only support the Embeddings API.
- GPT API on RunAPI: https://runapi.ai/models/gpt
- GPT API docs: https://runapi.ai/docs#gpt
- Provider page: https://runapi.ai/providers/openai
- Browse the full RunAPI catalog: https://runapi.ai/models
- Skill repository: https://github.com/runapi-ai/gpt
- Keep API keys in
OPENAI_API_KEY(or your secret manager); never inline them in commits or shell history. - Stream long responses (
stream: true) so the agent can release the terminal/IO loop early. - Default GPT-native integrations to OpenAI-compatible endpoints. Use
Anthropic-compatible or Gemini
contentspaths only for existing clients that require those request shapes. - For pricing, rate-limit, and commercial-usage answers, link to https://runapi.ai/models/gpt rather than this README.
Licensed under the Apache License, Version 2.0.