Skip to content

Calling providers

<METHOD> https://api.sociaro.com/<provider>/<provider-native-path>

The first path segment selects the provider; everything after it is the provider’s own API path, forwarded verbatim.

ProviderPrefixAuth headerUpstream API
OpenAI/openaiAuthorization: Bearerapi.openai.com
Anthropic/anthropicx-api-keyapi.anthropic.com
Alibaba (DashScope)/alibabaAuthorization: BearerDashScope
BytePlus (Ark)/byteplusAuthorization: BearerBytePlus Ark
MuleRouter/mulerouterAuthorization: BearerMuleRouter

(The exact provider list for your organization may differ — GET /gw/me shows which providers your key is entitled to.)

  • Request and response bodies are never modified — what the provider sends is what you receive, byte-for-byte.
  • SSE streaming is passed through unbuffered; time-to-first-token is the provider’s own.
  • Provider errors (4xx/5xx) are forwarded as-is — your provider-specific error handling keeps working.
  • The only header the gateway touches is the provider auth header (replaced with the real credential). traceparent and all other headers pass through.
HeaderMeaning
X-Gateway-Request-IdUnique ID (ULID) for every request. Include it when contacting support — it links directly to logs and usage records.

Before forwarding, the gateway enforces auth, entitlements, rate limits and budgets — see the error contract for the full table (401, 403, 429, 402, 502/504).

Tag any request with metadata for cost allocation; tags become dimensions in GET /gw/stats:

  • Canonical headers (configured per deployment): X-Project, X-Department, X-Persona, …
  • Arbitrary tags: any X-Attr-<name> header, e.g. X-Attr-Team: growth, X-Attr-Feature: chat — stored under the lowercased <name>.
Terminal window
curl https://api.sociaro.com/openai/v1/chat/completions \
-H "Authorization: Bearer gw_live_..." \
-H "X-Project: alpha" \
-H "X-Attr-Feature: onboarding" \
-d '{...}'

Then:

Terminal window
curl "https://api.sociaro.com/gw/stats?group_by=feature&since=7d" \
-H "Authorization: Bearer gw_live_..."

Video/image/3d generation endpoints (BytePlus Seedance, Alibaba Wan, MuleRouter, …) follow the same proxy model but have an asynchronous create→poll lifecycle with its own billing semantics — see async jobs.