Skip to content

GPT-6 Astra with Responses

Changing a model can also require changing the endpoint, input fields, and output handling. For gpt-6-astra, use Responses when calling functions or gateway MCP tools. Astra supports Chat Completions for requests without tools, but does not support none reasoning. Its supported efforts are low, medium, high, xhigh, and max. See the official OpenAI model guidance.

Client or routeRequest modelInputText output
shield.openai().responses.create(...)gpt-6-astrainputresponse.output_text
Native OpenAI SDK with base URL ending in /openaigpt-6-astrainputresponse.output_text
HTTP POST /v1/responsesopenai/gpt-6-astrainputoutput message items with output_text content

The SDK compatibility route sends requests to /openai/responses and defaults an unprefixed model to OpenAI. For the unified /v1/responses route, use the provider prefix for explicit routing; recognized bare model names can also resolve through the gateway’s model catalog. Supply reasoning={"effort": "low"} in Python or reasoning: { effort: "low" } in JavaScript. Remove legacy temperature, top_p, and log-probability options when moving to Astra.

Before running an example, configure an OpenAI provider credential in the gateway and a virtual key allowed to use this model. Set DEEPINTSHIELD_VIRTUAL_KEY in your environment. Set DEEPINTSHIELD_BASE_URL to your gateway origin, such as http://localhost:8080; the examples default to https://app.deepintshield.com.

Install deepintshield[openai]. The empty MCP filter makes this first request independent of any connected MCP servers.

from deepintshield import DeepintShield
shield = DeepintShield.from_env()
client = shield.openai()
response = client.responses.create(
model="gpt-6-astra",
input="Explain what an AI gateway does in one sentence.",
reasoning={"effort": "low"},
extra_headers={"x-deepintshield-mcp-include-clients": ""},
)
print(response.output_text)

For the native Python OpenAI SDK, the request above stays the same; construct client with your gateway URL and virtual key:

import os
from openai import OpenAI
gateway = os.getenv("DEEPINTSHIELD_BASE_URL", "https://app.deepintshield.com")
virtual_key = os.environ["DEEPINTSHIELD_VIRTUAL_KEY"]
client = OpenAI(
base_url=f"{gateway.rstrip('/')}/openai",
api_key=virtual_key,
default_headers={"x-deepintshield-vk": virtual_key},
)

Install the openai package and run this from a server environment where the virtual key is available.

import OpenAI from "openai";
const gateway =
process.env.DEEPINTSHIELD_BASE_URL ?? "https://app.deepintshield.com";
const virtualKey = process.env.DEEPINTSHIELD_VIRTUAL_KEY;
if (!virtualKey) throw new Error("Set DEEPINTSHIELD_VIRTUAL_KEY");
const client = new OpenAI({
baseURL: `${gateway.replace(/\/$/, "")}/openai`,
apiKey: virtualKey,
defaultHeaders: { "x-deepintshield-vk": virtualKey },
});
const response = await client.responses.create(
{
model: "gpt-6-astra",
input: "Explain what an AI gateway does in one sentence.",
reasoning: { effort: "low" },
},
{ headers: { "x-deepintshield-mcp-include-clients": "" } },
);
console.log(response.output_text);
Terminal window
curl "${DEEPINTSHIELD_BASE_URL:-https://app.deepintshield.com}/v1/responses" \
-H "Authorization: Bearer ${DEEPINTSHIELD_VIRTUAL_KEY}" \
-H "Content-Type: application/json" \
-H "x-deepintshield-mcp-include-clients;" \
-d '{
"model": "openai/gpt-6-astra",
"input": "Explain what an AI gateway does in one sentence.",
"reasoning": {"effort": "low"}
}'

curl’s semicolon form sends an explicitly empty header. A header ending in : suppresses that header instead, so it does not disable MCP tool injection. Read the raw JSON output array; output_text is an SDK convenience property, and choices[0].message.content belongs to Chat Completions.

DeepIntShield can add permitted MCP function schemas to an inference request even when your application does not pass tools. Omitting tools from a Chat Completions call therefore does not guarantee a request without tools. Astra’s tool-calling endpoint is Responses.

For MCP tools, remove the empty filter above, or replace its value with the configured client names needed for the request. Client settings, request filters, and virtual-key permissions intersect; a request filter can narrow access but cannot grant a tool. An explicit empty filter keeps MCP tools excluded, including when the virtual key has tool permissions. See MCP filtering and tool execution.

For application-defined functions, Responses uses a flat function definition, and tool results use function_call_output with the original call_id:

import json
# Reuse the authenticated client from the Python example.
tools = [{
"type": "function",
"name": "add",
"description": "Add two numbers.",
"parameters": {
"type": "object",
"properties": {"a": {"type": "number"}, "b": {"type": "number"}},
"required": ["a", "b"],
"additionalProperties": False,
},
"strict": True,
}]
history = [{"role": "user", "content": "Use add to calculate 15 plus 27."}]
for _ in range(5):
response = client.responses.create(
model="gpt-6-astra",
input=history,
tools=tools,
reasoning={"effort": "low"},
store=False,
include=["reasoning.encrypted_content"],
extra_headers={"x-deepintshield-mcp-include-clients": ""},
)
history.extend(response.output)
calls = [item for item in response.output if item.type == "function_call"]
if not calls:
print(response.output_text)
break
for call in calls:
if call.name != "add":
raise ValueError(f"Unexpected function: {call.name}")
args = json.loads(call.arguments)
history.append({
"type": "function_call_output",
"call_id": call.call_id,
"output": str(args["a"] + args["b"]),
})
else:
raise RuntimeError("Tool-call limit reached")

Keep every returned output item in subsequent input, including opaque reasoning items. The stateless example requests encrypted reasoning content for that continuation. See OpenAI reasoning guidance.

If the error says function tools are unsupported in Chat Completions with reasoning enabled, switch to responses.create, change messages to input, and read output_text or the structured output items. Do not follow a generic suggestion to set Astra’s reasoning effort to none; Astra rejects that value. Disabling gateway MCP injection is useful only when the request needs no MCP tools; it does not remove application-supplied tools or make Astra function calling work through Chat Completions.