openai-ai-integration

Installation
SKILL.md

OpenAI API Integration

Prerequisites

Load myai's engineering-principles first. This skill is a language-agnostic extension that covers only how to talk to an OpenAI-compatible LLM API: client choice, request shaping, configuration, structured output, resilient parsing, and retries. Examples are in Python with TypeScript references; the rules apply in any language with an official OpenAI SDK.

The OpenAI API is a weakly-typed dynamic boundary: it accepts untyped request dicts and returns untyped JSON. Treat it like a network boundary, not a type system — validate everything you consume and type everything you build on top.

Key Principles

  • Use the official OpenAI SDK (openai in Python and TypeScript, and in many other languages). Never hand-roll the HTTP calls — the SDK handles auth headers, timeouts, connection pooling, and error taxonomy.
  • Use chat.completions (Chat Completions format). It is the most compatible surface across OpenAI-compatible providers (OpenAI, OpenRouter, Ollama, ...), so the same code works against any of them via base_url.
  • Everything about the endpoint is configurable: base URL, model, reasoning effort, and API key must all be overridable through environment variables, config files, or app settings. The exact mechanism is application-specific.
  • Modern models need very few knobs. Do not send temperature or max_tokens by default. The only request parameters you normally touch are model, messages, response_format, and optionally reasoning_effort.

Defaults

Installs
2
First Seen
Aug 16, 2026
openai-ai-integration — quick-brown-foxxx/myai