---
ref: tool:openai/create-response
name: Create a response
company: company:openai
workflows: []
access: [cli, api]
tags: [capability:write-copy, category:ai-model, has:api, has:cli]
docs: https://developers.openai.com/api/reference/resources/responses/methods/create
updated: 2026-09-26
---

# Create a response

Generates text, or JSON that follows a schema you pass, from a prompt, optionally using tools such as web search.

Draft copy with a plain prompt. To classify records, pass a JSON schema in `text.format` (structured outputs) and read the label from the returned JSON.

## Set up

Use the first option your agent supports.

### CLI (official)

Install the command, then confirm it runs.

```sh
brew install openai/tools/openai
openai --version
```

Run `openai responses create`.

Set `$OPENAI_API_KEY` in your environment first (get a key: https://platform.openai.com/api-keys).

### API (official)

- Base URL: https://api.openai.com/v1
- Endpoint: `POST /responses`
- Auth: send the header `Authorization: Bearer $OPENAI_API_KEY`
- Get a key: https://platform.openai.com/api-keys
- Docs: https://developers.openai.com/api/reference/overview

Before doing anything else, make one read-only call to confirm access.

## Rules

- Ask the user before anything that sends messages, costs money, or changes data.
- Never print API keys.
