OpenCode error
OpenCode: AI_APICallError: model gpt-5-codex is not accessible via the...
AI_APICallError: model gpt-5-codex is not accessible via the /chat/completions endpointStatus: Fixed in releaseLast verified 1 documented fix2 sources
What it means
GitHub Copilot refused the gpt-5-codex model on the /chat/completions endpoint, which OpenCode used for Copilot at the time.
Causes
- OpenCode could not yet use Copilot's codex models (#2758, reported on 0.11.3).
How to fix it
- Fix 1.
Upgrade. PR #4914 "get codex working in copilot" was merged 2025-11-30. A maintainer: "This will be fixed in the next release ... rolled in his changes into main repo so that you can use codex w/ copilot."
Terminalopencode upgrade
More OpenCode errors
All 17 OpenCode errorsProviderModelNotFoundErrorStatus: By designProviderInitErrorStatus: WorkaroundAI_APICallErrorStatus: WorkaroundThis credential is only authorized for use with Claude Code and cannot be used for other API requests.Status: By designAI_APICallError: messages.13: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01CfJCsh21fK1pAXsXWYJYBA, toolu_01NoqnwsaxoK3AYM2FyrxmjN. Each `tool_use` block must have a corresponding `tool_result` block in the next message.Status: Fixed in releasemessages.3.content.0.type: Expected `thinking` or `redacted_thinking`, but found `tool_use`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`.Status: WorkaroundError: Unexpected error, check log file at [user-home]/.local/share/opencode/log/2025-08-26T215857.log for more detailsStatus: WorkaroundAI_RetryError: Failed after 4 attempts. Last error: Too Many RequestsStatus: Workaround
Related reading
- Slack Code vs Claude Code vs Cursor vs OpenCode: When Agents Belong in ChatSlack Code gives coding agents their own Slack channels with diffs, previews, and an audit log. When it beats Claude Code, Cursor, or OpenCode, and when not.
- OpenCode Hacked: What the Console Breach Means for Your API KeysOpenCode disclosed a breach of its Console that may have exposed provider keys. Who is affected, what to rotate today, and why hosted key gateways are the real risk.
- OpenCode 2: How to Upgrade From v1 Without Breaking Your SetupOpenCode 2 upgrade from v1: what the migration guide says breaks (plugins, server API, TUI config), what carries over, and a safe checklist before you switch.
- Run Your Coding Agent as an API: OpenCode Server on RailwayOpenCode server on Railway: run opencode serve in a container as a password-protected HTTP API with a persistent volume, reachable from any machine or webhook.
- Give Every Agent PR a Live Preview: Railway Environments for AI Pull RequestsRailway preview environments for agent pull requests: an isolated copy of your whole stack for every PR, so you verify agent changes by running them.
- GPT-6 Astra Release Guide: Benchmarks, $10/$50 Pricing, and How to Run It in Codex and OpenCodeGPT-6 Astra release guide: OpenAI's max-capability model, its $10/$50 pricing and 1.05M context, what the benchmarks do and do not say, and commands to try it.
FAQ
What does "AI_APICallError: model gpt-5-codex is not accessible via the..." mean in OpenCode?
GitHub Copilot refused the gpt-5-codex model on the /chat/completions endpoint, which OpenCode used for Copilot at the time.
How do I fix "AI_APICallError: model gpt-5-codex is not accessible via the..."?
Upgrade. PR #4914 "get codex working in copilot" was merged 2025-11-30. A maintainer: "This will be fixed in the next release ... rolled in his changes into main repo so that you can use codex w/ copilot."
Is this OpenCode error fixed?
Status: Fixed in release. A release fixed this. The affected versions note says where the fix landed. Affected versions: Reported from 0.11.3 (Sep 2025). Fixed by PR #4914 (merged 2025-11-30).
Sources
Last verified against 2 sources: official docs, maintainer replies and release notes.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.