[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EV6NPVM9NV702T3381QRGG":3,"skill-same:01M7EV6NPVM9NV702T3381QRGG":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EV6NPVM9NV702T3381QRGG","openai-api-pro",null,"OpenAI API guidance — chat\u002Fcompletions, function calling, structured outputs, embeddings, assistants, and cost control.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-openai-api-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: openai-api-pro\ndescription: OpenAI API guidance — chat\u002Fcompletions, function calling, structured outputs, embeddings, assistants, and cost control.\ncategory: development\n---\n\n## Overview\n\nThe OpenAI API is the reference LLM API: chat completions, structured outputs, function calling, embeddings, image\u002Faudio models, and batch processing. The patterns here — message roles, JSON mode, tool definitions, streaming — transfer to most other providers, so fluency with this API pays beyond OpenAI itself.\n\nThis skill covers using the API well: message construction, structured outputs, function calling, embeddings, the right model for the job, and the cost\u002Flatency controls that keep bills sane.\n\n## When to use\n\n- Calling the OpenAI API (chat, structured outputs, tools).\n- Designing function-calling \u002F tool-use integrations.\n- Getting reliable JSON from the model.\n- Choosing models (flagship vs mini vs reasoning).\n- Controlling cost and latency.\n- Using embeddings for search\u002FRAG.\n- Migrating between OpenAI and compatible APIs.\n\n## Core concepts\n\n- **Messages API.** `system` \u002F `user` \u002F `assistant` (+ `tool`) roles; conversation as a message list. System prompts set behavior; keep them focused — one job per system prompt beats a constitution.\n- **Model selection.** Flagship (hardest reasoning), mini (cheap\u002Ffast for simple tasks), reasoning models (o-series — for math\u002Fcode\u002Flogic with visible effort). Right-size per task: classify with mini, reason with flagship. The cost spread is 10-100x.\n- **Structured outputs.** `response_format` with JSON schema (strict mode) — guaranteed schema-conforming JSON. For anything downstream parses, structured outputs beat \"please return JSON\" prompting.\n- **Function calling \u002F tools.** `tools` array with JSON-schema parameters; the model returns `tool_calls`, you execute and return results. Tools are how LLMs act — design them like APIs: clear names, descriptions, narrow scope.\n- **Streaming.** `stream: true` — tokens as they're generated; essential UX for chat (perceived latency), plus early cancellation. Handle tool-call streaming's chunked-argument assembly.\n- **Embeddings.** `text-embedding-3-*` — `large` for quality, `small` for cost; `dimensions` parameter for truncated vectors (Matryoshka — shorter vectors, minimal quality loss). Normalize for cosine similarity; batch inputs.\n- **Temperature\u002Ftop_p.** Temperature 0 for deterministic tasks (classification, extraction); higher for creative. `top_p` as the alternative sampler — tune one, not both.\n- **Reasoning effort.** For o-series: `reasoning_effort` (low\u002Fmedium\u002Fhigh) trades tokens for thought — low for quick checks, high for hard problems. Don't pay for deep reasoning on shallow tasks.\n- **Batch API.** 50% discount for non-urgent workloads (24h turnaround) — embeddings backfills, evaluations, bulk classification. The easiest cost win for offline work.\n- **Caching.** Prompt caching (automatic on long prefixes) — repeated system prompts + context cost a fraction after the first call. Structure prompts with stable prefixes to maximize cache hits.\n- **Rate limits and retries.** Tiered RPM\u002FTPM; exponential backoff with jitter on 429s; request timeouts. The API is a shared resource — design clients that degrade gracefully.\n- **Safety.** Moderation endpoint for user content, instruction hierarchy (system > developer > user), no secrets in prompts, PII awareness. Validate tool outputs before acting on them.\n- **Assistants API (awareness).** The stateful assistants abstraction exists but the ecosystem has moved toward self-managed threads + tools — know it exists, prefer explicit control for new builds.\n- **Evals.** Model-graded and deterministic evals on golden sets — run before every prompt\u002Fmodel change. The API makes it easy to call models; evals make it safe to change them.\n- **Multimodal endpoints.** Image generation\u002Fediting, Whisper transcription, TTS speech, image inputs for vision — beyond text; audio models power voice interfaces.\n- **Fine-tuning.** Supervised fine-tuning for consistent style\u002Fformat on narrow tasks — when prompting plateaus; needs evals, and doesn't reliably inject new knowledge.\n\n## Practical workflow\n\n1. **Start with the right model.** Prototype on flagship, then distill: can mini handle it with a better prompt? Measure quality, not vibes.\n2. **Structure the messages.** Focused system prompt, clear user message, examples where format matters:\n   ```python\n   response = client.chat.completions.create(\n       model=\"gpt-4.1-mini\",\n       messages=[\n           {\"role\": \"system\", \"content\": \"Extract invoice fields. Return JSON only.\"},\n           {\"role\": \"user\", \"content\": invoice_text},\n       ],\n       response_format={\"type\": \"json_schema\",\n                        \"json_schema\": {\"name\": \"invoice\", \"strict\": True,\n                                        \"schema\": Invoice.model_json_schema()}},\n       temperature=0,\n   )\n   ```\n3. **Use structured outputs.** JSON schema strict mode for all machine-consumed output; Pydantic models as the schema source; validate anyway.\n4. **Design tools carefully.** Narrow functions, precise descriptions, typed parameters; execute server-side; return concise results (token-efficient tool outputs).\n5. **Stream to users.** `stream=True` for interactive paths; assemble tool-call arguments from chunks correctly.\n6. **Batch the offline work.** Batch API for evaluations, backfills, bulk jobs — half price for patience.\n7. **Control costs.** Token logging per request, budgets and alerts, prompt caching via stable prefixes, right-sized models, max_tokens limits.\n8. **Evaluate changes.** Golden dataset + model-graded evals in CI; every prompt or model change runs the suite before shipping.\n\n## Common pitfalls\n\n- **Flagship for everything** — 50x cost for tasks mini handles; right-size per task.\n- **Unstructured JSON prompting** — \"return JSON\" without schema; strict structured outputs.\n- **Temperature > 0 for extraction** — nondeterministic structured tasks; temperature 0.\n- **No retries\u002Fbackoff** — 429s crashing clients; exponential backoff with jitter.\n- **Ignoring prompt caching** — unstable prompt prefixes; stable long prefixes for cache hits.\n- **Batch API unused** — paying full price for offline work; 50% off for 24h turnaround.\n- **Tool sprawl** — dozens of vague tools; narrow, well-described, few.\n- **No evals** — prompt changes by feel; golden sets + graded evals.\n- **Secrets in prompts** — API keys in context sent to third parties; scrub and scope.\n- **Streaming mishandled** — broken tool-call assembly; handle chunked arguments.\n- **No token logging** — surprise bills; log and budget per request\u002Ffeature.\n- **Reasoning overkill** — high effort on trivial tasks; match effort to difficulty.\n- **Embedding without normalization** — cosine on unnormalized vectors; normalize (or use dot-product-aware stores).\n","## Overview\n\nThe OpenAI API is the reference LLM API: chat completions, structured outputs, function calling, embeddings, image\u002Faudio models, and batch processing. The patterns here — message roles, JSON mode, tool definitions, streaming — transfer to most other providers, so fluency with this API pays beyond OpenAI itself.\n\nThis skill covers using the API well: message construction, structured outputs, function calling, embeddings, the right model for the job, and the cost\u002Flatency controls that keep bills sane.\n\n## When to use\n\n- Calling the OpenAI API (chat, structured outputs, tools).\n- Designing function-calling \u002F tool-use integrations.\n- Getting reliable JSON from the model.\n- Choosing models (flagship vs mini vs reasoning).\n- Controlling cost and latency.\n- Using embeddings for search\u002FRAG.\n- Migrating between OpenAI and compatible APIs.\n\n## Core concepts\n\n- **Messages API.** `system` \u002F `user` \u002F `assistant` (+ `tool`) roles; conversation as a message list. System prompts set behavior; keep them focused — one job per system prompt beats a constitution.\n- **Model selection.** Flagship (hardest reasoning), mini (cheap\u002Ffast for simple tasks), reasoning models (o-series — for math\u002Fcode\u002Flogic with visible effort). Right-size per task: classify with mini, reason with flagship. The cost spread is 10-100x.\n- **Structured outputs.** `response_format` with JSON schema (strict mode) — guaranteed schema-conforming JSON. For anything downstream parses, structured outputs beat \"please return JSON\" prompting.\n- **Function calling \u002F tools.** `tools` array with JSON-schema parameters; the model returns `tool_calls`, you execute and return results. Tools are how LLMs act — design them like APIs: clear names, descriptions, narrow scope.\n- **Streaming.** `stream: true` — tokens as they're generated; essential UX for chat (perceived latency), plus early cancellation. Handle tool-call streaming's chunked-argument assembly.\n- **Embeddings.** `text-embedding-3-*` — `large` for quality, `small` for cost; `dimensions` parameter for truncated vectors (Matryoshka — shorter vectors, minimal quality loss). Normalize for cosine similarity; batch inputs.\n- **Temperature\u002Ftop_p.** Temperature 0 for deterministic tasks (classification, extraction); higher for creative. `top_p` as the alternative sampler — tune one, not both.\n- **Reasoning effort.** For o-series: `reasoning_effort` (low\u002Fmedium\u002Fhigh) trades tokens for thought — low for quick checks, high for hard problems. Don't pay for deep reasoning on shallow tasks.\n- **Batch API.** 50% discount for non-urgent workloads (24h turnaround) — embeddings backfills, evaluations, bulk classification. The easiest cost win for offline work.\n- **Caching.** Prompt caching (automatic on long prefixes) — repeated system prompts + context cost a fraction after the first call. Structure prompts with stable prefixes to maximize cache hits.\n- **Rate limits and retries.** Tiered RPM\u002FTPM; exponential backoff with jitter on 429s; request timeouts. The API is a shared resource — design clients that degrade gracefully.\n- **Safety.** Moderation endpoint for user content, instruction hierarchy (system > developer > user), no secrets in prompts, PII awareness. Validate tool outputs before acting on them.\n- **Assistants API (awareness).** The stateful assistants abstraction exists but the ecosystem has moved toward self-managed threads + tools — know it exists, prefer explicit control for new builds.\n- **Evals.** Model-graded and deterministic evals on golden sets — run before every prompt\u002Fmodel change. The API makes it easy to call models; evals make it safe to change them.\n- **Multimodal endpoints.** Image generation\u002Fediting, Whisper transcription, TTS speech, image inputs for vision — beyond text; audio models power voice interfaces.\n- **Fine-tuning.** Supervised fine-tuning for consistent style\u002Fformat on narrow tasks — when prompting plateaus; needs evals, and doesn't reliably inject new knowledge.\n\n## Practical workflow\n\n1. **Start with the right model.** Prototype on flagship, then distill: can mini handle it with a better prompt? Measure quality, not vibes.\n2. **Structure the messages.** Focused system prompt, clear user message, examples where format matters:\n   ```python\n   response = client.chat.completions.create(\n       model=\"gpt-4.1-mini\",\n       messages=[\n           {\"role\": \"system\", \"content\": \"Extract invoice fields. Return JSON only.\"},\n           {\"role\": \"user\", \"content\": invoice_text},\n       ],\n       response_format={\"type\": \"json_schema\",\n                        \"json_schema\": {\"name\": \"invoice\", \"strict\": True,\n                                        \"schema\": Invoice.model_json_schema()}},\n       temperature=0,\n   )\n   ```\n3. **Use structured outputs.** JSON schema strict mode for all machine-consumed output; Pydantic models as the schema source; validate anyway.\n4. **Design tools carefully.** Narrow functions, precise descriptions, typed parameters; execute server-side; return concise results (token-efficient tool outputs).\n5. **Stream to users.** `stream=True` for interactive paths; assemble tool-call arguments from chunks correctly.\n6. **Batch the offline work.** Batch API for evaluations, backfills, bulk jobs — half price for patience.\n7. **Control costs.** Token logging per request, budgets and alerts, prompt caching via stable prefixes, right-sized models, max_tokens limits.\n8. **Evaluate changes.** Golden dataset + model-graded evals in CI; every prompt or model change runs the suite before shipping.\n\n## Common pitfalls\n\n- **Flagship for everything** — 50x cost for tasks mini handles; right-size per task.\n- **Unstructured JSON prompting** — \"return JSON\" without schema; strict structured outputs.\n- **Temperature > 0 for extraction** — nondeterministic structured tasks; temperature 0.\n- **No retries\u002Fbackoff** — 429s crashing clients; exponential backoff with jitter.\n- **Ignoring prompt caching** — unstable prompt prefixes; stable long prefixes for cache hits.\n- **Batch API unused** — paying full price for offline work; 50% off for 24h turnaround.\n- **Tool sprawl** — dozens of vague tools; narrow, well-described, few.\n- **No evals** — prompt changes by feel; golden sets + graded evals.\n- **Secrets in prompts** — API keys in context sent to third parties; scrub and scope.\n- **Streaming mishandled** — broken tool-call assembly; handle chunked arguments.\n- **No token logging** — surprise bills; log and budget per request\u002Ffeature.\n- **Reasoning overkill** — high effort on trivial tasks; match effort to difficulty.\n- **Embedding without normalization** — cosine on unnormalized vectors; normalize (or use dot-product-aware stores).\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-openai-api-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill openai-api-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill openai-api-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill openai-api-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-openai-api-pro\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]