GPT-6 Astra in Codex CLI: complete setup and reasoning effort guide

You set gpt-6-astra in Codex CLI, chose model_reasoning_effort = "xhigh", and still have a question: is the model actually using that reasoning level? This guide shows the configuration and the API results from our test.

We ran these checks on MandAPI infrastructure. The point is to compare what the client requests with what the API returns, including reasoning tokens and structured tool calls.

Visual flow from Codex CLI through the Responses API to GPT-6 Astra reasoning

MandAPI test recorded on November 7, 2026. Results can vary with the provider, client and configuration.

What is GPT-6 Astra?

gpt-6-astra (current alias gpt-6-astra-2026-09-03) is OpenAI's flagship model, released in September 2026. These specifications matter for this setup:

Specification Value
Context window 1,050,000 tokens
Maximum output 128,000 tokens
Knowledge cutoff April 30, 2026
Endpoints v1/responses, v1/chat/completions, v1/batch, v1/realtime, v1/assistants
Function calling Supported
Streaming and Structured Outputs Supported

For Codex CLI, the essential route is the Responses API (/v1/responses).

Does GPT-6 Astra work with Codex CLI 0.151.0?

Yes, provided the integration uses the Responses API. In config.toml, set wire_api = "responses" for the MandAPI provider.

Codex CLI uses Responses by default. Problems arise when a gateway implements only /v1/chat/completions, or silently converts /v1/responses into that older route. The CLI may then fail or behave unexpectedly without a clear error.

How to configure GPT-6 Astra in Codex CLI

Step 1: set the API key in an environment variable

export MANDAPI_API_KEY="sk-your-key-here"

Step 2: edit ~/.codex/config.toml

model = "gpt-6-astra"
model_provider = "mandapi"
model_reasoning_effort = "xhigh"
approval_policy = "never"

[model_providers.mandapi]
name = "MandAPI"
base_url = "https://api.mandapi.com/v1"
env_key = "MANDAPI_API_KEY"
wire_api = "responses"

Step 3: confirm that Codex loaded it

codex exec --skip-git-repo-check -C . "reply with OK only" < /dev/null

For this noninteractive test, keep < /dev/null. Otherwise Codex can wait at Reading additional input from stdin..., which is easy to mistake for an API outage. The output header shows the model and approval policy that were loaded from your configuration.

Three configuration mistakes to avoid

1. Putting model_reasoning_effort inside the provider block

# INCORRECT: Codex silently ignores this placement
[model_providers.mandapi]
model_reasoning_effort = "xhigh"
# CORRECT: set it at the root of the file
model_reasoning_effort = "xhigh"

[model_providers.mandapi]
name = "MandAPI"

The setting belongs at the root level. Inside [model_providers.*], it is discarded without a warning, so you may think you selected xhigh when the model uses its default.

2. Using a wire_api other than responses

In this integration, reasoning_effort only takes effect through the Responses API. With wire_api = "chat", the parameter does not reach the model.

3. Not restarting Codex

Codex reads config.toml when the process starts. Restart it after changing the file.

Does reasoning_effort = "xhigh" really work?

It works when the provider forwards the parameter. Two situations can look identical in a log: a gateway accepts and displays xhigh, or it actually forwards xhigh to the model. The log alone cannot distinguish them.

Our test

We asked GPT-6 Astra to identify one counterfeit coin among 12 with only three balance-scale weighings, including whether it was heavier or lighter. The request used reasoning.effort = "xhigh" and max_output_tokens = 2000.

reasoning_tokens  = 1,034
output_tokens     = 1,958
returned items    = reasoning, reasoning, message
parameter echo    = {"effort":"xhigh","mode":"standard"}
response time     = 53 s

The 1,034 reasoning tokens show that the model used a reasoning budget. The two type=reasoning items provide a second signal, and the response echoes the requested effort. Together, those fields tell us more than a dashboard label alone.

Accepted values

low | medium | high | xhigh | max

In our test, the model rejected none and minimal with HTTP 400. max is available for the most demanding tasks, at higher time and token cost than xhigh.

Why does reasoning_tokens sometimes return 0?

If your provider forwards the parameter, check these two common client-side causes first.

max_output_tokens is too low

On the Responses API, max_output_tokens includes reasoning tokens. A limit of 32 or 128 may leave no useful room for reasoning, even when effort is set to xhigh. For this test, allow at least 2,000 output tokens and increase the budget for harder tasks.

The prompt is trivial

A prompt such as “reply with OK only” is useful for a connection check, but it does not test reasoning depth. Use a multi-step task. You can also add this setting to config.toml and look for a reasoning summary:

model_reasoning_summary = "detailed"

Cost: reasoning tokens count as output

Responses API reasoning tokens are included in output token usage. In our test, the final answer was about 2,500 characters, while output_tokens was 1,958; 1,034 of those were internal reasoning tokens rather than visible answer text.

Moving from medium to xhigh can therefore raise the cost of a call even if the final answer is the same length. In our test, 3,844 input tokens came from cache, which reduced effective input cost in the longer session.

Use xhigh for architecture, complex refactoring and difficult debugging. For mechanical work, test medium or low and compare both quality and cost.

Test the provider with curl before configuring Codex

Test 1: does /v1/responses respond?

curl -s https://api.mandapi.com/v1/responses \
  -H "Authorization: Bearer $MANDAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-6-astra","input":"hello","max_output_tokens":16}' \
  -o response.json -w "%{http_code}\n"

An HTTP 200 confirms that the route responded to this request. A 404 indicates that the expected route is unavailable at that endpoint.

Test 2: is reasoning forwarded?

curl -s https://api.mandapi.com/v1/responses \
  -H "Authorization: Bearer $MANDAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"gpt-6-astra",
    "input":"Explain how to identify one counterfeit coin among 12 with a balance scale in only three weighings, without knowing if it is heavier or lighter.",
    "max_output_tokens":2000,
    "reasoning":{"effort":"xhigh"}
  }' -o response.json

Inspect usage.output_tokens_details.reasoning_tokens and the top-level reasoning field. For this diagnostic task, our response returned more than zero reasoning tokens and echoed {"effort":"xhigh","mode":"standard"}.

Test 3: are tools forwarded?

curl -s https://api.mandapi.com/v1/responses \
  -H "Authorization: Bearer $MANDAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"gpt-6-astra",
    "input":"What is the weather in São Paulo? Use the tool.",
    "max_output_tokens":200,
    "tools":[{"type":"function","name":"get_weather",
      "description":"Returns the weather for a city",
      "parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}]
  }' -o response.json

Look for a "type": "function_call" item in output. Our test returned a structured function call with a function name and JSON arguments. If a gateway drops tools, a coding agent may still chat but cannot use the tools it needs to edit files.

Tool calling and a provider checklist

GPT-6 Astra supports native function calling. For a Codex CLI integration, check three things in order:

  1. Does the provider serve /v1/responses?
  2. Does a multi-step request return reasoning usage and the requested effort?
  3. Does a simple tool definition produce a structured function_call?

Ask for API response fields as evidence; a generic compatibility claim is less useful than these checks.

Frequently asked questions

Does GPT-6 Astra work with Codex CLI 0.151.0?

Yes, when the provider uses the Responses API and wire_api = "responses".

Which reasoning effort should I set?

The values in our test were low, medium, high, xhigh and max. The model rejected none and minimal. xhigh is a starting point for complex engineering work.

Why is reasoning_tokens zero with xhigh?

Check the output token budget and the difficulty of the prompt first. A trivial connection test does not demonstrate reasoning use.

Must I restart Codex after changing config.toml?

Yes. Codex loads the configuration at process startup.

Why does codex exec stop at “Reading additional input from stdin”?

For a noninteractive shell test, redirect standard input with < /dev/null.

Where is the Codex CLI configuration file?

At ~/.codex/config.toml; on Windows, %USERPROFILE%\.codex\config.toml.

Next step

Create a MandAPI account, run the three checks with your own key, and compare the response fields with this test. Explore available models, current prices and the compatible API guide.