Quickstart — ML Junction docs

1. Configure credentials

Create an API key in the dashboard and store it only on your server. Never embed a secret API key in browser JavaScript, mobile bundles, public repositories, logs, or analytics events.

ASTRO_API_KEY=your_secret_api_key
ASTRO_BASE_URL=https://api.mljunction.com

2. Send a canonical request

curl "$ASTRO_BASE_URL/v1/responses" \
  -H "Authorization: Bearer $ASTRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      {
        "role": "user",
        "content": "Explain capability-safe fallback in three paragraphs."
      }
    ],
    "routing": {
      "strategy": "balanced"
    }
  }'

3. Read the response and receipt

{
  "id": "resp_...",
  "model": "gpt-5.5",
  "output": [
    {
      "type": "text",
      "text": "Capability-safe fallback means..."
    }
  ],
  "finish_reason": "stop",
  "usage": {
    "input_tokens": 18,
    "cached_input_tokens": 0,
    "output_tokens": 142,
    "reasoning_tokens": 0,
    "total_tokens": 160
  },
  "routing": {
    "selected_route": "openai-gpt-5.5-global-standard",
    "provider": "openai",
    "provider_model": "gpt-5.5",
    "billing_mode": "platform",
    "credential_source": "platform",
    "fallback_used": false,
    "attempts": 1,
    "sticky_hit": false,
    "decision_reason": "primary_route"
  },
  "receipt": {
    "route_id": "openai-gpt-5.5-global-standard",
    "provider": "openai",
    "provider_model": "gpt-5.5",
    "region": "global",
    "fallback_layer": "primary",
    "estimated_charge_usd": 0.0004,
    "actual_charge_usd": 0.00038,
    "pricing_source": "https://..."
  },
  "warnings": []
}

The exact model IDs available to your deployment come from GET /v1/models. Do not hard-code IDs copied from a provider website without checking the catalog.

Canonical URL: https://mljunction.com/docs/quickstart