View plans
Developer documentation

Connect your tools to StreamNest.

Gateway notes, Anthropic-compatible Messages API examples, and Claude Code setup. Read the deployment note before using this with customer traffic.

Production base URL: https://api.streamnest.shop. Requests are served over HTTPS through the StreamNest API gateway. Keep your customer API key private and never paste it into public chats, screenshots, or repositories.

1. Overview

StreamNest's current gateway is intended to accept Anthropic-style requests at /v1/messages and forward them to the configured upstream. The gateway's health check is /health. A model alias observed in the existing setup is claude-fable-5-1, routed internally to auto/claude-sonnet. Aliases and upstream targets can change; query the live models endpoint before relying on a model name.

2. Gateway base URL

Production gateway base URL
https://api.streamnest.shop
Endpoints
GET  /health
GET  /v1/models
POST /v1/messages

Production requests should use https://api.streamnest.shop. The internal gateway port should remain private behind the reverse proxy.

3. Authentication

Use the API key issued by your StreamNest backend/admin. The examples use YOUR_STREAMNEST_API_KEY as a placeholder; replace it locally and never paste a real key into docs, screenshots, chat, or public repositories.

Anthropic-compatible clients typically send the key as x-api-key and include an anthropic-version header. Confirm the exact requirements against the deployed gateway implementation.

4. Endpoints

MethodPathPurpose
GET/healthGateway health status. Does not prove that every upstream model is healthy.
GET/v1/modelsList the model IDs currently exposed by this gateway.
POST/v1/messagesAnthropic-style message request; streaming may use server-sent events.

5. Quickstart with cURL

Health check (no customer key expected by the current health endpoint):

curl -i --max-time 10 \
  https://api.streamnest.shop/health

List exposed models:

curl -sS \
  https://api.streamnest.shop/v1/models \
  -H "x-api-key: YOUR_STREAMNEST_API_KEY"

Send a non-streaming Messages API request:

curl -sS --max-time 90 \
  https://api.streamnest.shop/v1/messages \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_STREAMNEST_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-fable-5-1",
    "max_tokens": 128,
    "messages": [
      {"role": "user", "content": "Reply only with OK"}
    ],
    "stream": false
  }'

The example model is an alias previously observed in this setup. If /v1/models lists a different ID, use the exact live ID returned by the endpoint.

6. Claude Models

Explore the Claude model options available through StreamNest. Available model families include:

  • Claude Opus
  • Claude Sonnet
  • Claude Haiku
  • Claude Fable

Specific model versions and access depend on current API availability and your selected plan.

7. Claude Code setup

Claude Code versions and environment-variable behavior may change. Check the current Claude Code documentation and confirm the gateway accepts Anthropic-compatible API requests before configuring it. Do not put a provider's private upstream key here; use only a customer key created by StreamNest.

Important: this configuration works only if your gateway fully supports the Anthropic Messages API features Claude Code sends, including streaming and tool-use events. If you see “The response stream was malformed”, “tool calling not supported”, or unsupported beta errors, the gateway/upstream compatibility needs fixing before Claude Code will work reliably.

macOS / Linux (temporary for this terminal)

export ANTHROPIC_BASE_URL="https://api.streamnest.shop"
export ANTHROPIC_API_KEY="YOUR_STREAMNEST_API_KEY"
claude

Use the production HTTPS base URL shown above. If your installed Claude Code version requires different variables or supports a settings-file configuration instead, follow its current official docs.

Persistent shell setup (zsh example)

cat >> ~/.zshrc <<'EOF'
# StreamNest gateway (replace with your HTTPS domain in production)
export ANTHROPIC_BASE_URL="https://api.streamnest.shop"
export ANTHROPIC_API_KEY="YOUR_STREAMNEST_API_KEY"
EOF
source ~/.zshrc
claude

Keep secrets out of shared shell profiles if other users can access your machine. Prefer a secret manager or a private environment file with restricted permissions.

Windows PowerShell (current session)

$env:ANTHROPIC_BASE_URL = "https://api.streamnest.shop"
$env:ANTHROPIC_API_KEY = "YOUR_STREAMNEST_API_KEY"
claude

8. Streaming behavior

When the client sends "stream": true, the gateway must return a valid event stream with the expected Anthropic event sequence and complete event frames. A plain JSON response, OpenAI-style chunks passed through unchanged, missing event names, malformed JSON in a data: frame, or a missing final event can cause the client to report a malformed response stream.

If streaming fails but non-streaming works, record the request time and correlation/request ID if available, then inspect gateway logs without exposing the API key or prompt contents. Do not assume an HTTP 200 alone proves the stream is valid.

9. Troubleshooting

ErrorLikely cause / next step
401 Invalid API keyUse a valid StreamNest customer key and verify that the key is active.
429 Rate limit exceededUpstream or customer quota reached. Apply retry/backoff and inspect provider quota.
400 tool calling not supportedThe selected upstream/model route does not support tools sent by the client; configure a tool-capable route.
response stream was malformedInspect SSE event names, frame separators, JSON validity, content-block events and stream termination.
image content is not supportedThe selected fallback model cannot accept image content. Route image requests only to a vision-capable model.
502/503Check upstream reachability, provider status, timeout settings and gateway logs.

Never paste unredacted authorization headers, API keys or customer message content into support chats or public logs.

10. Production security checklist

  • Use a domain with HTTPS/TLS; do not expose a raw HTTP API key on public networks.
  • Keep the gateway process bound to localhost behind a reverse proxy where possible; firewall direct access to the internal port.
  • Use per-customer keys, store only secure hashes of keys, support revocation and show new secrets once.
  • Enforce customer quotas and admin permissions server-side; do not trust frontend checks.
  • Protect admin routes with secure authentication, session cookies, CSRF protection where applicable, rate limiting and audit logs.
  • Redact secrets from logs, apply request size/time limits, and monitor upstream usage and costs.
  • Publish accurate terms, privacy policy, support contact and plan/renewal details before taking payment.

11. Support

For StreamNest plan and setup questions, contact WhatsApp support: +91 92883 79757.

StreamNest is an independent service and is not affiliated with or endorsed by Anthropic. Use product names only to identify compatibility and plan options.