openai-api

openai-api is a skill for Claude Code, Codex from pinkpixel-dev/imaginate-mcp. It costs 226 tokens per session (1,597 once invoked), scanned A, original, Apache-2.0.

A reference for building applications with the OpenAI API, including text, images, audio, structured JSON results, web and file search, function calls, and other tools.

In plain words
What is it for?
Use it when starting or maintaining an OpenAI integration, choosing between the Responses API and Chat Completions, or adding generation, vision, audio, structured output, or tools.
Why use it?
It helps developers select the recommended API and understand how to connect these capabilities to their applications.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/pinkpixel-dev/imaginate-mcp/openai-api
Any agent
npx skills add pinkpixel-dev/imaginate-mcp --skill openai-api
Clone the repo
git clone --depth 1 https://github.com/pinkpixel-dev/imaginate-mcp

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-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/pinkpixel-dev/imaginate-mcp/openai-api.svg)](https://agentmods.dev/skills/pinkpixel-dev/imaginate-mcp/openai-api)
Your own site
<a href="https://agentmods.dev/skills/pinkpixel-dev/imaginate-mcp/openai-api"><img src="https://agentmods.dev/badge/skills/pinkpixel-dev/imaginate-mcp/openai-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 226 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,597 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00226 $0.01597
Opus 5 $0.00113 $0.00798
Sonnet 5 $0.00045 $0.00319
Haiku 4.5 $0.00023 $0.00160

Measured 3d ago against content hash e1a27f5b9923, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

openai-api scanned grade A with 1 finding 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 3d ago.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

description: Complete reference for building with the OpenAI API — Responses API (the recommended primitive), Chat Completions, text generation/prompting, vision/image understanding, GPT Image generation, audio/speech (r
.agents/skills/openai-api/SKILL.md · 76 lines

How it starts

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

OpenAI API

Badass reference for wiring up the OpenAI API — built from the latest OpenAI docs (Responses API generation, migrated from Chat Completions and its being deprecated on a timeline; images/vision; audio; structured outputs; tools; pricing).

Golden rule: use the Responses API for anything new

Responses API (/v1/responses) is the recommended primitive for all new projects. Chat Completions (/v1/chat/completions) still works and is still supported, but Responses is the future-facing API: better performance with reasoning models, native multi-tool agentic loop in a single request, better prompt caching (lower cost), stateful conversation management, and it's what all new built-in tools (web search, file search, remote MCP, computer use, image generation, tool search) are designed around.

Only reach for Chat Completions when:

  • You're maintaining/extending an existing Chat Completions integration and a full migration isn't worth it right now
  • You need the audio-in-chat pattern (modalities: ["text","audio"]) — Responses docs currently describe text/image in, text out only; use Chat Completions with an audio-capable model (gpt-audio-1.5) for that specific case, or Realtime for live voice.

If the user has existing Chat Completions code and wants to modernize it, see references/migrating-to-responses.md.

Routing table — which reference file to read

User is asking about... Read this file
Basic text generation, prompting, instructions vs input, message roles (developer/user/assistant), model selection, prompt versioning references/text-generation.md
Migrating existing Chat Completions code to Responses, mapping messages→Items, streaming event differences, multi-turn state (previous_response_id vs manual replay vs Conversations API) references/migrating-to-responses.md
Image input/vision (analyzing images, detail levels, tokenization/cost of image inputs), or image generation (GPT Image, gpt-image-2, editing images) references/images-vision.md
Audio: speech-to-text, text-to-speech, realtime voice agents, speech-to-speech, adding audio to an existing chat app references/audio-speech.md
Structured Outputs, JSON schema responses, text.format, JSON mode, refusals field, function calling with strict schemas references/structured-outputs.md
Tools: web search, file search, function calling, remote MCP servers, tool search (deferred tool loading), computer use, Agents SDK tool wiring references/tools.md
Pricing, cost per token, batch vs priority vs flex pricing tiers, which model is cheapest, cost calculators references/pricing.md

Read the full file on GitHub · 76 lines

Files

What ships with it

7 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. 3d ago First seen · 76 lines · 226 tokens per session scan A e1a27f5b9923

Subscribe to this mod's changes

openai-api is a skill published in the GitHub repository pinkpixel-dev/imaginate-mcp (1 stars, last pushed 8d ago), licensed Apache-2.0. It adds 226 tokens to every session and 1,597 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

image-prompt

Use when the user wants to turn a short idea into a rich, production-grade image-generation prompt — posters, landing-page or UI mockups, ads, editorial layouts, photoreal scenes, game screenshots, logos, or illustrations. Builds ONE structured, copy-paste-ready prompt optimized for gpt-image-2 by default, following…

veryCoolTimo/imagegen-skills · 148 tokens

midjourney

How to build a Midjourney prompt with Limner, subject and style first, then parameter flags and optional image references. Load when generating with the Midjourney pipeline.

vinsonconsulting/limner · 39 tokens

pipeline-router

Choose the right Limner generation pipeline for an asset, matching output kind, cost, and speed across Midjourney, DALL·E, and Recraft, then finishing with upscale, vectorize, or compose. Load when unsure which pipeline to use.

vinsonconsulting/limner · 55 tokens

universal-video-prompt-skill

Write one model-agnostic video prompt spec, then compile it to whichever video model you can actually call. Use for cross-model prompt work, model comparison matrices, reusing one brief across providers, or when the target model is not yet available and the work must proceed on another one.

AtlasCloudAI/atlas-cloud-skills · 66 tokens

replicate-images

Use when generating or editing images through the Replicate API, or when a modern image model keeps ignoring the prompt — choosing aspect ratio, resolution, seed and output format, image-to-image, multi-reference composition, text-driven inpainting, readable text inside a generated image, and structuring prompts per…

ericrisco/rsc-harness · 84 tokens

flux-3-product-ads

Use when building a finished product ad from FLUX 3 - shot design, voiceover, action-to-word sync, evidence-gated copy, deterministic assembly, and QC gates that catch clipped audio, floating products, off-model plates, and reports that claim a pass the build did not give.

black-forest-labs/skills · 66 tokens