HridaSpro Docs

Advanced

Reasoning Tokens

Reasoning tokens and controlling reasoning effort through Spro.

Reasoning models expose their internal thinking as reasoning tokens before producing the final answer. Spro passes reasoning through untouched — you request it with the standard OpenAI parameters, and it works across every reasoning-capable provider in the catalog.

Reasoning tokens

Tokens spent on reasoning count toward completion_tokens and are billed by the provider. On the Responses API, reasoning models return a dedicated reasoning output item, so you can tell thinking apart from the answer:

from openai import OpenAI
client = OpenAI(    base_url="https://spro.hridaai.com/v1",    api_key="YOUR_SPRO_API_KEY",)
response = client.responses.create(    model="gpt-oss-20b",    input="How many golf balls fit inside a jetliner?",)
for item in response.output:    if item.type == "reasoning":        print("Reasoning summary:", item.summary)    elif item.type == "message":        print("Answer:", "".join(c.text for c in item.content if c.type == "output_text"))
print("Reasoning tokens:", response.usage.output_tokens_details.reasoning_tokens)

With the Chat Completions API, reasoning arrives in message.reasoning_content when the provider reports it, and in the reasoning tokens field of usage.

Controlling reasoning effort

Use the standard OpenAI reasoning_effort parameter — low, medium (default), or high — to control how many reasoning tokens a model spends:

response = client.chat.completions.create(    model="gpt-oss-20b",    messages=[{"role": "user", "content": "Prove that there are infinitely many primes."}],    reasoning_effort="high",)
response = client.responses.create(    model="gpt-oss-20b",    input="Prove that there are infinitely many primes.",    reasoning={"effort": "high"},)

Higher effort spends more reasoning tokens (higher cost and latency) in exchange for better performance on hard problems. For simple tasks, low keeps responses fast and cheap.

Provider-specific options with extra_body

Some providers — like Z.AI (z-ai/... models) — expose their own thinking parameters that aren't part of the OpenAI schema. Pass them through with extra_body:

response = client.chat.completions.create(    model="z-ai/glm-5.3-flash",    messages=[{"role": "user", "content": "Plan a 3-day trip to Kyoto."}],    extra_body={"thinking": {"type": "enabled"}},)

Unknown fields in extra_body are forwarded to the provider as-is, so any provider-native option works — Spro validates the OpenAI schema and passes everything else through.

What's Next