openai

openai is a skill for Claude Code, Codex from ashish7802/awesome-api-skills. It costs 0 tokens per session (527 once invoked), scanned A, original, MIT.

A guide to OpenAI's REST API, which lets applications send requests to machine-learning models for tasks such as generating text, creating embeddings, and analyzing images. It covers authentication, conversations, streaming responses, and context limits.

In plain words
What is it for?
Use it to install the OpenAI library, send chat requests, stream responses, trim or summarize oversized conversations, retry rate-limited requests, and work with embeddings or vision models.
Why use it?
It helps you handle long requests, rate limits, failed calls, and prompt-injection risks when adding model features to an application. It also explains how to keep API keys out of frontend code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to install the OpenAI library, send chat requests, stream responses, trim or summarize oversized conversations, retry rate-limited requests, and work with embeddings or vision models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashish7802/awesome-api-skills/openai
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ashish7802/awesome-api-skills --skill openai
Clone the repo
git clone --depth 1 https://github.com/ashish7802/awesome-api-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openai

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/openai/github.svg)](https://agentmods.dev/skills/ashish7802/awesome-api-skills/openai)
Your own site
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/openai"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/openai/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openai

Your own site · 80×15
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/openai"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/openai.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00527
Opus 5 $0.00000 $0.00264
Sonnet 5 $0.00000 $0.00105
Haiku 4.5 $0.00000 $0.00053

Measured 9d ago against content hash c8131057fe4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

openai scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (examples/basic.ts, examples/example.py, examples/example.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/openai/SKILL.md · 61 lines

How it starts

The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenAI API Skill

Overview

OpenAI provides advanced machine learning models via REST API. This skill covers Chat Completions, Embeddings, and Vision models, focusing on streaming architectures and context management.

Installation

npm install openai
pip install openai

Authentication

Authenticate using a Bearer token (OPENAI_API_KEY). For enterprise organizations, supply the OPENAI_ORG_ID to properly attribute billing.

Core Concepts

  • Messages: An array of { role, content } objects representing conversation history.
  • Temperature: Controls randomness (0.0 for deterministic, 1.0 for creative).
  • Tokens: The atomic unit of billing and context limits.

Common Workflows

  1. Construct a system prompt.
  2. Append user input to the messages array.
  3. Call chat.completions.create with stream: true for low-latency UX.

Error Handling

Catch OpenAIError. Handle RateLimitError (HTTP 429) via exponential backoff. Handle LengthError by dynamically summarizing or trimming the context window before retrying.

Security

Never inject unsanitized user input directly into system prompts to avoid prompt injection attacks. Do not leak API keys in frontend bundles.

Rate Limits

Limits are tiered based on usage. Tier 1 allows 500 RPM for GPT-3.5 and 500 RPM for GPT-4. Tier 5 allows 10,000 RPM.

Best Practices

Use max_tokens defensively to bound costs. Utilize function calling (tools) to ensure the model outputs strictly typed JSON data rather than relying on regex parsing.

Troubleshooting

If you receive 'Context window exceeded', count tokens using tiktoken before sending the request.

References

Why use this skill

Use this when your agent works with openai — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using deprecated model IDs or wrong API endpoints
  • Confusing chat vs completions vs embeddings APIs
  • Omitting rate-limit and token budget handling

Read the full file on GitHub · 61 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 61 lines · 0 tokens per session scan A c8131057fe4b

Subscribe to this mod's changes

openai is a skill published in the GitHub repository ashish7802/awesome-api-skills (13 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 527 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

composio

Build AI agents and apps with Composio - access 200+ external tools with Tool Router or direct execution.

aAAaqwq/AGI-Super-Team · 26 tokens

flowise-builder

Use when flowise visual LLM workflow builder — drag-drop chatflows, API endpoints, document loaders, tools. Use when working with flowise builder.

oyi77/1ai-skills · 35 tokens

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect BOLA/IDOR attacks, rate limit bypass, credential scanning, and injection attempts. Uses pandas for statistical analysis of request patterns and anomaly detection. Use when investigating API abuse or building API-specific threat detection rules.

pinkpixel-dev/skills-collection-1 · 72 tokens

gemini-api-integration

Use when integrating Google Gemini API into projects. Covers model selection, multimodal inputs, streaming, function calling, and production best practices.

beel-collab/presets.dev · 27 tokens

azure-search-documents-ts

Build search applications using Azure AI Search SDK for JavaScript (@azure/search-documents). Use when creating/managing indexes, implementing vector/hybrid search, semantic ranking, or building agentic retrieval with knowledge bases.

microsoft/skills · 48 tokens

ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI…

vercel-labs/open-agents · 155 tokens