[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [GPT-5 Pro](https://spiral.ai/integrations/opencode/gpt-5-pro)

# How to Use GPT-5 Pro in opencode

GPT-5 Pro suits demanding science, math, and coding questions. It always uses high reasoning effort and supports a 272,000-token output budget, compared with GPT-5's 128,000.

|  |  |
| --- | --- |
| Model | GPT-5 Pro |
| Available through | OpenAI |
| Category | LLM |
| Price | Up to $0.639659 per run at the default inputs. $19.50 per 1M input tokens, $156.00 per 1M output tokens. |
| Returns | text, json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with GPT-5 Pro in opencode

- Use GPT-5 Pro to review this project's database migration code. Identify possible data loss, ordering problems, and rollback gaps; cite the relevant functions and propose focused fixes.
- Use GPT-5 Pro to plan a refactor of the duplicated validation logic in this project. Preserve current behavior, identify affected callers, and define checks for each proposed change.
- Ask GPT-5 Pro through Spiral to review the diff on this branch and list the three riskiest changes. Save the result in ./assets.
- Get a second opinion from GPT-5 Pro on this function, then tell me what the call cost.
- Summarize these release notes with GPT-5 Pro in five bullet points.

## How to set up GPT-5 Pro in opencode

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run GPT-5 Pro**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "openai",
    "model": "openai/gpt-5-pro",
    "input": {
      "messages": [
        {
          "role": "system"
        }
      ]
    }
  }'
```

Then paste one of the prompts above: opencode finds GPT-5 Pro on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## GPT-5 Pro tools and prices

- [GPT-5 Pro](https://spiral.ai/tools/openai/openai/gpt-5-pro) (OpenAI): Up to $0.639659 per run at the default inputs. $19.50 per 1M input tokens, $156.00 per 1M output tokens.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| tools |  | — |  |
| reasoning |  | — | Reasoning effort; reasoning tokens count toward max_tokens. |
| max_tokens | 16 to 272000 | — | The most output tokens to generate. |
| tool_choice |  | — |  |
| response_format |  | — |  |
| reasoning_effort | high | high | How much the model reasons. |

## What can you do with GPT-5 Pro in opencode?

Turn a bug report into a focused code change, or get an explanation of unfamiliar project code. Give GPT-5 a clear scope and acceptance criteria so the result is easy to review.

### Debug a failing workflow

Provide the relevant code, error messages, and expected behavior. Ask for a likely cause, a focused correction, and a test that would catch the failure.

### Plan a code refactor

Ask for a refactor that preserves public behavior, identifies affected callers, and explains which checks should pass before accepting the change.

### Explain an unfamiliar codebase

Supply relevant modules and ask how a request moves through them. Request references to the functions that handle validation, state changes, and errors.

### Review a mathematical argument

Provide a proposed solution and ask for unsupported steps, missing assumptions, and a concise corrected argument.

### Draft a technical report

Turn supplied findings into a report for a defined audience. Require separate sections for observations, interpretation, and unresolved questions.

### Edit a decision memo

Ask for a clearer recommendation, explicit tradeoffs, and a list of claims that need supporting evidence. Set a word limit and preserve the supplied facts.

### Explain a scientific result

Provide the result, method, and stated assumptions. Ask for an explanation of the argument and questions that would help assess the conclusion.

## Overview

- [OpenAI](https://spiral.ai/providers/openai)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## GPT-5 Pro in other agents

- [Amp](https://spiral.ai/integrations/amp/gpt-5-pro)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/gpt-5-pro)
- [Claude](https://spiral.ai/integrations/claude-desktop/gpt-5-pro)
- [Claude Code](https://spiral.ai/integrations/claude-code/gpt-5-pro)
- [Cline](https://spiral.ai/integrations/cline/gpt-5-pro)
- [Codex](https://spiral.ai/integrations/codex/gpt-5-pro)
- [Cursor](https://spiral.ai/integrations/cursor/gpt-5-pro)
- [Devin](https://spiral.ai/integrations/devin/gpt-5-pro)
- [dots](https://spiral.ai/integrations/dots/gpt-5-pro)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/gpt-5-pro)
- [Gemini](https://spiral.ai/integrations/gemini/gpt-5-pro)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/gpt-5-pro)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/gpt-5-pro)
- [goose](https://spiral.ai/integrations/goose/gpt-5-pro)
- [Grok](https://spiral.ai/integrations/grok/gpt-5-pro)
- [Grok Build](https://spiral.ai/integrations/grok-build/gpt-5-pro)
- [Hermes](https://spiral.ai/integrations/hermes/gpt-5-pro)
- [Instinct](https://spiral.ai/integrations/instinct/gpt-5-pro)
- [Manus](https://spiral.ai/integrations/manus/gpt-5-pro)
- [Muse](https://spiral.ai/integrations/muse/gpt-5-pro)
- [Muse Code](https://spiral.ai/integrations/muse-code/gpt-5-pro)
- [n8n](https://spiral.ai/integrations/n8n/gpt-5-pro)
- [Notion](https://spiral.ai/integrations/notion/gpt-5-pro)
- [OpenClaw](https://spiral.ai/integrations/openclaw/gpt-5-pro)
- [Perplexity](https://spiral.ai/integrations/perplexity/gpt-5-pro)
- [Raycast](https://spiral.ai/integrations/raycast/gpt-5-pro)
- [VS Code](https://spiral.ai/integrations/vscode/gpt-5-pro)
- [Windsurf](https://spiral.ai/integrations/windsurf/gpt-5-pro)
- [Zapier](https://spiral.ai/integrations/zapier/gpt-5-pro)

## More opencode guides

- [GPT-5 Nano](https://spiral.ai/integrations/opencode/gpt-5-nano)
- [GPT-5.1](https://spiral.ai/integrations/opencode/gpt-5-1)
- [GPT-5 Mini](https://spiral.ai/integrations/opencode/gpt-5-mini)
- [GPT-5.2](https://spiral.ai/integrations/opencode/gpt-5-2)
- [GPT-5](https://spiral.ai/integrations/opencode/gpt-5)
- [GPT-5.2 Pro](https://spiral.ai/integrations/opencode/gpt-5-2-pro)

## Questions about GPT-5 Pro in opencode

**Can opencode use GPT-5 Pro?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run GPT-5 Pro like any built-in tool.

**How much does GPT-5 Pro cost in opencode?**

Up to $0.639659 per run at the default inputs. $19.50 per 1M input tokens, $156.00 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

**Do I need an OpenAI account to use GPT-5 Pro in opencode?**

No. Spiral runs GPT-5 Pro on its own OpenAI account. You sign in to Spiral once and never paste a key.

**How long does it take to set up GPT-5 Pro in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while GPT-5 Pro runs?**

GPT-5 Pro runs in the background. opencode starts the run, checks on it and gives you the text, json when it's ready.

**What is GPT-5 useful for?**

GPT-5 is useful for debugging, editing code, and explaining complex codebases. Practical writing tasks include drafting and editing reports, emails, and memos.

**How much context can GPT-5 handle?**

GPT-5 and GPT-5 Pro each have a 400,000-token context window. Treat that as a total context limit, rather than a promise that you can submit that much source text and still receive a full-length answer.

**Does GPT-5 know about recent events?**

GPT-5 and GPT-5 Pro have a September 30, 2024 knowledge cutoff. Supply dated source material when your question depends on newer events or changes.

**Can I ask GPT-5 for a short answer?**

Yes. Specify the length and structure directly, such as a 150-word explanation or a table followed by three recommendations.

**How should I prompt GPT-5?**

State the task, relevant evidence, constraints, and desired output clearly. Check that your instructions agree, especially when combining standing rules with a new request.

