provod.ai / docs
API

Model reasoning

Check reasoning parameter support and its effect on token usage.

Last updated on

Model reasoning

Reasoning controls depend on the model and API format. Check catalog supported_parameters and the selected model documentation first.

Chat Completions uses reasoning_effort; Responses uses reasoning.effort. Allowed values and constraints can differ. Do not apply one model setting to every model. Omitting the parameter does not necessarily disable reasoning.

Reasoning tokens may count as paid output even when their text is hidden. Allow sufficient output tokens and budget: use a supported max_tokens or max_completion_tokens in Chat Completions, or max_output_tokens in Responses. Do not send both Chat Completions limit names together. Compare the actual response accounting and request record in Usage, rather than estimating cost from visible text length.

Cached input and reasoning output are different categories. Do not add categories again when they are already included in total token counts. Another platform's public cache controls are not parameters of this API.

Catalog · Responses · Costs

Send a request with explicit effort

Requires Bash, curl, jq, an AI_API_KEY and an exact MODEL_ID. Choose an available model whose contract confirms reasoning_effort and the value low. Do not discover support by repeating paid requests. Running the example makes one paid request.

set -euo pipefail
: "${AI_API_KEY:?Set the API key for your workspace}"
: "${MODEL_ID:?Choose a model with documented low reasoning effort support}"
API_BASE="${API_BASE:-https://api.provod.ai}"

REQUEST_JSON="$(jq -n --arg model "$MODEL_ID" '{
  model: $model,
  messages: [{role: "user", content: "What is 17 multiplied by 19?"}],
  reasoning_effort: "low"
}')"
RESPONSE_JSON="$(curl --fail-with-body --silent --show-error "$API_BASE/v1/chat/completions" \
  -H "Authorization: Bearer $AI_API_KEY" \
  -H "Content-Type: application/json" --data-binary "$REQUEST_JSON")"

jq -e '
  if (.choices[0].message.content | type) != "string"
  then error("No text response; inspect the response") else
    {text: .choices[0].message.content,
     finish_reason: .choices[0].finish_reason,
     usage: .usage}
  end
' <<<"$RESPONSE_JSON"

Read finish_reason and actual usage: an absent reasoning breakdown does not mean zero cost. A length finish reason means the result was limited and can be incomplete. For Responses use the separate reasoning: {"effort": "low"} field only when the selected contract supports it.

Troubleshooting

On this page