How to use GPT-6 Astra with OmniaKey
Create a key, make a Responses API call, then connect Python, Node.js, or Codex.
This tutorial takes you from a new OmniaKey account to a successful GPT-6 Astra request. It covers server-side API calls and Codex CLI. An OmniaKey API key is not a ChatGPT subscription and cannot be pasted into the ChatGPT website.
Use these exact values: model gpt-6-astra, base URL https://api.omniakey.com/v1, and Responses endpoint POST /v1/responses. Start with reasoning.effort set to medium.
OpenAI's current Astra guide starts with the Responses API. Chat Completions remains available for plain text, but Astra tool calling requires Responses. The examples below follow that boundary and use an environment variable instead of placing a key in source code.
Before you start
Create a scoped API key
Sign in to OmniaKey and open the API Keys page. Create a key for this integration, then set a quota and expiration that match the test. Copy the key when it appears.
Your account also needs usable balance. Creating a key proves that the credential exists; it does not prove that the account can fund a request.
Treat the key like a password. Do not commit it, paste it into a browser application, include it in screenshots, or send it in chat.
Put the key in your environment
On macOS or Linux:
export OMNIAKEY_API_KEY="your-omniakey-api-key"
In PowerShell:
$env:OMNIAKEY_API_KEY="your-omniakey-api-key"
The SDK and Codex examples below read this same variable.
Make your first Responses API request
Run this request in a terminal:
curl https://api.omniakey.com/v1/responses \
-H "Authorization: Bearer $OMNIAKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-astra",
"reasoning": {"effort": "medium"},
"input": "Review this migration plan. Return the two highest risks and one acceptance test for each."
}'
A successful response contains an output array, generated text, and token usage. This first call verifies the base URL, key, balance, model permission, model ID, and Responses route together.
After it succeeds, open the usage dashboard and confirm that the recorded model is gpt-6-astra. Review actual input, cached input, reasoning, and output usage instead of estimating cost from visible text alone.
Call Astra from Python
Install or update the official OpenAI Python SDK:
python -m pip install --upgrade openai
Create astra_example.py:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["OMNIAKEY_API_KEY"],
base_url="https://api.omniakey.com/v1",
)
response = client.responses.create(
model="gpt-6-astra",
reasoning={"effort": "medium"},
input="Explain this incident report, then list the three most useful follow-up checks.",
)
print(response.output_text)
Run it:
python astra_example.py
response.output_text is the SDK convenience field for the generated text. Keep the complete response when you also need usage, status, or tool-call items.
Call Astra from Node.js
Install the SDK:
npm install openai
Create a server-side file such as astra-example.mjs:
import OpenAI from "openai";
const apiKey = process.env.OMNIAKEY_API_KEY;
if (!apiKey) throw new Error("OMNIAKEY_API_KEY is required");
const client = new OpenAI({
apiKey,
baseURL: "https://api.omniakey.com/v1",
});
const response = await client.responses.create({
model: "gpt-6-astra",
reasoning: { effort: "medium" },
input: "Review this API design. Identify two failure modes and a test for each.",
});
console.log(response.output_text);
Run it from the shell where the environment variable is set:
node astra-example.mjs
Run this code on a server, local machine, or trusted worker. A frontend bundle exposes any key it contains to visitors.
Use GPT-6 Astra in Codex CLI
Codex uses the Responses wire format with a custom provider. Add this to ~/.codex/config.toml:
model = "gpt-6-astra"
model_provider = "omniakey"
[model_providers.omniakey]
name = "OmniaKey"
base_url = "https://api.omniakey.com/v1"
env_key = "OMNIAKEY_API_KEY"
wire_api = "responses"
Launch Codex from a shell that has the key:
export OMNIAKEY_API_KEY="your-omniakey-api-key"
codex
Do not add requires_openai_auth = true to this provider. That mode uses OpenAI account authentication and causes Codex to ignore the custom provider's env_key.
Check the model shown by Codex, then run a small read-only task before allowing edits. A successful direct cURL request and a failed Codex request usually indicate client configuration rather than model access.
Use Chat Completions only when the client needs it
GPT-6 Astra accepts plain-text Chat Completions. Use this route for a client that has not adopted Responses:
curl https://api.omniakey.com/v1/chat/completions \
-H "Authorization: Bearer $OMNIAKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-astra",
"reasoning_effort": "medium",
"messages": [
{"role": "user", "content": "Summarize the two main risks in this rollout plan."}
]
}'
Notice the parameter difference: Responses uses reasoning.effort; Chat Completions uses reasoning_effort. Do not attach Astra tools to the Chat Completions example. OpenAI's current model guide requires Responses for Astra tool calling.
Choose the reasoning effort
| Effort | Start here when |
|---|---|
low | The task is bounded, easy to verify, or latency-sensitive |
medium | You are making the first representative request |
high | The task needs deeper planning or cross-file checking |
xhigh / max | A measured acceptance test still fails at lower effort |
Astra supports low, medium, high, xhigh, and max; it does not support none. Higher effort can increase reasoning work, latency, and output-token charges without guaranteeing a correct answer. Use the lowest setting that passes your acceptance test.
Give Astra a testable task
A good first prompt states the goal, relevant context, constraints, and completion check:
Goal: review this database migration for deployment risk.
Context: PostgreSQL 15, one production writer, rollback must finish within five minutes.
Constraints: do not propose destructive commands; distinguish verified facts from assumptions.
Done when: return the top three risks, one mitigation and one acceptance test for each.
For coding work, also name the repository rules and the exact command that proves completion. Astra follows accessible instruction files closely, so review AGENTS.md, skills, and similar files before giving the model tool access.
Fix common setup errors
401, unauthorized, or invalid API key
Confirm that OMNIAKEY_API_KEY is set in the same shell that runs the command. The environment variable contains only the key; Bearer belongs in the HTTP header. Check that the key is enabled and has not expired.
Insufficient balance or quota
Check both account balance and the key's own quota. A funded account can still fail when the scoped key has reached its cap.
Model not found or unavailable
Use the exact ID gpt-6-astra. Check the live model page and confirm that this key is permitted to use the model. Display names such as GPT 6 are not API IDs.
Unsupported parameter
Remove temperature, top_p, and top_logprobs. Also remove logprobs from Chat Completions and message.output_text.logprobs from the Responses include list. These parameters are not supported by Astra.
The response is incomplete or has no visible text
Increase max_output_tokens and inspect output_tokens_details.reasoning_tokens. Reasoning tokens consume output budget before the visible answer is complete.
Chat works but tools fail
Move the workflow to /v1/responses. Start with a plain-text Responses call, then add one tool and verify its full request, result, timeout, and permission path. The official OpenAI tool list describes the model's direct capability; a gateway or client can expose a narrower surface.
Codex still uses another model
Check model, model_provider, base_url, env_key, and wire_api in the active Codex config. Then restart Codex from the shell where OMNIAKEY_API_KEY is set.
Verify cost before production
Run one representative task, confirm the usage record, and calculate its complete cost including retries. The live Astra model page owns current OmniaKey pricing; the Astra review separates gateway pricing from OpenAI's direct rates and explains the 272K direct-price boundary.