Routernesia.id
API References

Chat Responses API

Chat Responses API documentation

Create chat responses

Generates a model response api for the given conversation.

Endpoint

POST /api/v1/responses

Authorization

Type: Bearer Token

API key is required to authorize requests. Obtain a key from your Routernesia dashboard.

Header: Authorization: Bearer <token>

Request Body

cURL

curl --location 'https://api.routernesia.id/api/v1/responses' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
    "input": [
        {
            "type": "message",
            "role": "system",
            "content": "You are a helpful assistant and help me to solve the problems"
        },
        {
            "type": "message",
            "role": "user",
            "content": "hello"
        }
    ],
    "model": "openai/o1",
    "stream": false,
    "text": {}
}'

Response Body

Success Response (200)

{
    "created": 0,
    "id": "resp_0dc70525180cfa3e006976ce7e9b7c8195b0069b261a240eae",
    "model": "o1-2024-12-17",
    "object": "response",
    "output": [
        {
            "id": "rs_0dc70525180cfa3e006976ce84c1d0819592e904ebb40182d4",
            "summary": [],
            "type": "reasoning"
        },
        {
            "content": [
                {
                    "annotations": [],
                    "logprobs": [],
                    "text": "Hello! How can I help you today?",
                    "type": "output_text"
                }
            ],
            "id": "msg_0dc70525180cfa3e006976ce8501548195b216bad54773dc06",
            "role": "assistant",
            "status": "completed",
            "type": "message"
        }
    ],
    "usage": {
        "input_tokens": 23,
        "output_tokens": 74,
        "total_tokens": 97
    }
}

Error Responses

401 Unauthorized

Invalid or missing API key.

422 Unprocessable Entity

Invalid request parameters.

Notes

  • The model parameter must be a valid model ID available in your Routernesia account
  • Ensure the model is support for Responses API

On this page