Skip to content

First request

After Quick start, you should have a model route named fast and a gateway API key. These examples use the default address; adjust it if you changed the port.

Terminal window
export GPROXY_KEY='your-gproxy-api-key'

The gateway accepts Authorization: Bearer <key>, x-api-key, and x-goog-api-key. Use a gateway key, not an upstream credential.

Terminal window
curl -sS http://127.0.0.1:8787/v1/chat/completions \
-H "Authorization: Bearer $GPROXY_KEY" \
-H 'content-type: application/json' \
-d '{"model":"fast","messages":[{"role":"user","content":"Say hello."}]}'
Terminal window
curl -sS http://127.0.0.1:8787/v1/responses \
-H "Authorization: Bearer $GPROXY_KEY" \
-H 'content-type: application/json' \
-d '{"model":"fast","input":"Say hello."}'
Terminal window
curl -sS http://127.0.0.1:8787/v1/messages \
-H "x-api-key: $GPROXY_KEY" \
-H 'anthropic-version: 2026-10-21' \
-H 'content-type: application/json' \
-d '{"model":"fast","max_tokens":256,
"messages":[{"role":"user","content":"Say hello."}]}'
Terminal window
curl -sS "http://127.0.0.1:8787/v1beta/models/fast:generateContent" \
-H "x-goog-api-key: $GPROXY_KEY" \
-H 'content-type: application/json' \
-d '{"contents":[{"parts":[{"text":"Say hello."}]}]}'
Terminal window
curl -sSN http://127.0.0.1:8787/v1/chat/completions \
-H "Authorization: Bearer $GPROXY_KEY" \
-H 'content-type: application/json' \
-d '{"model":"fast","stream":true,
"messages":[{"role":"user","content":"Count to three."}]}'
Terminal window
curl -sSN "http://127.0.0.1:8787/v1beta/models/fast:streamGenerateContent?alt=sse" \
-H "x-goog-api-key: $GPROXY_KEY" \
-H 'content-type: application/json' \
-d '{"contents":[{"parts":[{"text":"Count to three."}]}]}'

Responses use the protocol requested by the client. Success depends on route members, upstream capabilities, and conversion support. Changing the endpoint does not add capabilities to the upstream.

Use the console’s model catalog to find configured gateway names. To query the caller-visible gateway catalog through the API:

Terminal window
curl -sS http://127.0.0.1:8787/portal/api/models \
-H "Authorization: Bearer $GPROXY_KEY"

permitted indicates whether the caller can use an entry. GET /v1/models forwards the selected upstream’s model list, which is different from the gateway catalog. Application does not expose /portal/api over HTTP; use its in-app catalog.

URLModel in requestTarget
/v1/chat/completionsfastThe fast route
/openai-main/v1/chat/completionsUpstream model IDThe openai-main provider
/acme/v1/chat/completionsfastThe acme/fast route

See Models and routes for naming rules.

StatusMeaning
400Invalid request or configuration value
401Missing, invalid, disabled, or expired key
403Insufficient permissions or OAuth scope
404Unknown model, route, or resource
429A rate or quota limit applies
5xxGateway or upstream failure; inspect the logs

After a request, check usage and request records in the console. Body retention depends on logging settings; see Usage, logs, and audit.