Documentation

Your first request

Verify the URL, key, model and balance with a minimal request.

Prepare

You need cURL. Replace the sample key with the complete console key and the model ID with an allowed ID copied from pricing. Run this locally or on a server, and keep credentials out of shared terminal history.

bash
export RELAY_BASE_URL='https://api.neatrouter.com'
export RELAY_API_KEY='your-api-key'
export RELAY_MODEL_ID='your-model-id'

Claude Messages

Choose a Claude model that supports Messages, then run:

bash
curl --fail-with-body "$RELAY_BASE_URL/v1/messages" \
  -H "x-api-key: $RELAY_API_KEY" \
  -H 'anthropic-version: 2023-06-01' \
  -H 'content-type: application/json' \
  -d @- <<JSON
{"model":"$RELAY_MODEL_ID","max_tokens":128,"messages":[{"role":"user","content":"Hello"}]}
JSON

OpenAI Chat Completions

Choose a model supporting Chat Completions. This endpoint differs from Responses.

bash
curl --fail-with-body "$RELAY_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $RELAY_API_KEY" \
  -H 'content-type: application/json' \
  -d @- <<JSON
{"model":"$RELAY_MODEL_ID","messages":[{"role":"user","content":"Hello"}]}
JSON

Verify

A successful response includes generated content and usage. Check the model, tokens and settled charge in Usage logs. Test tool calling, image input and reasoning parameters separately for the selected model.

On failure, keep the local request ID and check the error reference. For streaming, add "stream": true and use curl -N. Once content has arrived, avoid automatically repeating the entire request.

Still have a question?

Support details have not been published.

On this page