--- name: openai description: Make and edit images with GPT Image, transcribe audio, and write with GPT through the OpenAI API. Use when the user asks for a picture from OpenAI, a transcript of a recording, or a GPT answer. Needs OPENAI_API_KEY. --- # OpenAI Key: `OPENAI_API_KEY`. Get one at https://platform.openai.com/settings/organization/api-keys Examples pipe JSON through `jq`. Without it, read the JSON and take the field named in each step. ## Make an image ```bash curl -s https://api.openai.com/v1/images/generations \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2.5-sunburst","prompt":"A neon sign that says OPEN LATE, rain on the glass"}' \ | jq -r '.data[0].b64_json' | base64 --decode > image.png ``` Synchronous. The picture comes back as base64 in `data[0].b64_json`. `gpt-image-2.5-flare` is the faster model. ## Transcribe audio ```bash curl -s https://api.openai.com/v1/audio/transcriptions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F model=gpt-transcribe -F file=@interview.mp3 ``` ## Write something ```bash curl -s https://api.openai.com/v1/responses \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-6-astra","input":"Ten hook ideas for a cooking reel."}' ``` ## Notes - A 403 on an image model means the organization isn't verified yet. Verify it under Settings → Organization → General. - OpenAI's video API (Sora) closed in September 2026. For video, use the `openrouter` or `kie-ai` skill. - Current models: `curl -s https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"`.