Skip to main content
Every interaction with Routeway follows the same request/response cycle. Understanding the shape of these objects makes it easier to integrate the API, handle edge cases, and debug issues.

Request Object

A minimal chat completion request looks like this:

Common Parameters

temperature and top_p both control randomness. Use one or the other — not both. For deterministic tasks like data extraction, set temperature: 0. For creative tasks, try values between 0.7 and 1.2.

Full Request Example


Response Object

A successful response looks like this:

Key Fields

finish_reason Values

Always check finish_reason. A value of "length" means the response was cut off. Handle it by either increasing max_tokens or detecting and requesting a continuation.

Accessing the Response Text

The model’s reply lives at choices[0].message.content:
When n > 1, multiple completions are returned and you index into choices[0], choices[1], etc. When the model calls a tool instead of replying with text, content may be null and tool_calls will be populated:

Error Responses

When something goes wrong, Routeway returns a standard error object:
See the Errors page for the full list and handling guidance.

HTTP Headers

Every request must include:
The response includes a x-request-id header you can use when contacting support about a specific call.