using-openai-platform
БесплатноБез исполняемых скриптовНе проверенOpenAI SDK development with GPT-5 family, Chat Completions, Responses API, embeddings, and tool calling. Use for AI-powered applications, chatbots, agents…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
OpenAI SDK Development Skill
Quick Reference
OpenAI SDK development with Python and TypeScript/JavaScript clients. Covers GPT-5 family models, Chat Completions API, Responses API, embeddings, tool calling, and streaming.
Progressive Disclosure: This file provides quick reference patterns. See REFERENCE.md for comprehensive API coverage, advanced patterns, and deep dives.
Table of Contents
- When to Use
- GPT-5 Model Family
- Quick Start
- Chat Completions API
- Responses API (Next Gen)
- Tool Calling
- Embeddings
- Error Handling
- Platform Differentiators
- Further Reading
- Context7 Integration
When to Use
This skill is loaded by backend-developer when:
openaipackage inrequirements.txtorpyproject.tomlopenaiinpackage.jsondependencies- Environment variables
OPENAI_API_KEYpresent - User mentions "OpenAI", "GPT", or "ChatGPT" in task
GPT-5 Model Family
Model Selection Guide
| Model | Context | Best For | Cost |
|---|---|---|---|
gpt-5.2 |
400K | Flagship - coding, agentic, multimodal | $1.75/$14 |
gpt-5.2-pro |
400K | Maximum reasoning (xhigh effort) | $21/$168 |
gpt-5.1 |
256K | Stable, previous generation | $1.50/$12 |
gpt-5.1-codex |
256K | Long-running coding tasks | $1.50/$12 |
gpt-5 |
128K | General purpose | $1.25/$10 |
gpt-4o |
128K | Fast, cost-effective | $2.50/$10 |
gpt-4o-mini |
128K | Cheapest, simple tasks | $0.15/$0.60 |
Costs per 1M tokens (input/output). Cached input: 50-90% discount.
Quick Selection
Simple chat/Q&A -> gpt-4o-mini
Standard tasks -> gpt-4o or gpt-5
Complex reasoning -> gpt-5.1 with reasoning_effort="high"
Coding/agentic -> gpt-5.2 or gpt-5.1-codex
Maximum intelligence -> gpt-5.2-pro with reasoning_effort="xhigh"
Reasoning Effort (GPT-5.1+)
reasoning_effort = "none" # Fast, no reasoning
reasoning_effort = "low" # Light reasoning
reasoning_effort = "medium" # Default
reasoning_effort = "high" # Extended reasoning
reasoning_effort = "xhigh" # Maximum (GPT-5.2 Pro only)
Quick Start
Python Setup
from openai import OpenAI
# Client auto-uses OPENAI_API_KEY env var
client = OpenAI()
response = client.chat.completions.create(
model="gpt-5",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)
TypeScript Setup
import OpenAI from 'openai';
const openai = new OpenAI();
const response = await openai.chat.completions.create({
model: 'gpt-5',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello!' }
]
});
console.log(response.choices[0].message.content);
Async Python
import asyncio
from openai import AsyncOpenAI
async def main():
client = AsyncOpenAI()
response = await client.chat.completions.create(
model="gpt-5",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
asyncio.run(main())
Chat Completions API
Basic Completion
response = client.chat.completions.create(
model="gpt-5",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is Python?"}
],
temperature=0.7,
max_tokens=1000
)
answer = response.choices[0].message.content
usage = response.usage # tokens used
Message Roles
| Role | Description |
|---|---|
system |
Sets behavior/context (first message) |
user |
Human input |
assistant |
Model responses |
tool |
Tool/function results |
Common Parameters
| Parameter | Type | Description |
|---|---|---|
model |
string | Model ID (e.g., "gpt-5") |
messages |
array | Conversation messages |
temperature |
0-2 | Randomness (0=deterministic) |
max_tokens |
int | Max response tokens |
stream |
boolean | Enable streaming |
response_format |
object | JSON mode |
tools |
array | Tool definitions |
reasoning_effort |
string | Reasoning level (GPT-5.1+) |
JSON Mode
response = client.chat.completions.create(
model="gpt-5",
messages=[
{"role": "system", "content": "Return JSON only."},
{"role": "user", "content": "List 3 programming languages."}
],
response_format={"type": "json_object"}
)
data = json.loads(response.choices[0].message.content)
Streaming
stream = client.chat.completions.create(
model="gpt
Установить using-openai-platform в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл using-openai-platform?
OpenAI SDK development with GPT-5 family, Chat Completions, Responses API, embeddings, and tool calling. Use for AI-powered applications, chatbots, agents, and semantic search.
Как установить скилл using-openai-platform?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл using-openai-platform запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic