> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Launch on the free router

> Start with ai-stats/free so your first integration can run without choosing a single fixed free model up front.

Use this recipe to get your first AI Stats integration running without picking a paid model yet.

Instead of picking one free model yourself, send requests to `ai-stats/free`. AI Stats will choose an available free model that supports the request you are making.

## When to use this

* You want a working prototype before choosing a paid model.
* You expect the best free option to change over time.
* You want one stable model ID in application code while AI Stats handles free-provider changes behind the scenes.

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.phaseo.app/v1/responses \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "ai-stats/free",
      "input": "Summarize why provider-aware free routing helps prototypes.",
      "temperature": 0.2
    }'
  ```

  ```typescript TypeScript SDK theme={null}
  import AIStats from "@ai-stats/sdk";

  const client = new AIStats({ apiKey: process.env.AI_STATS_API_KEY! });

  const response = await client.generateResponse({
    model: "ai-stats/free",
    input: "Summarize why provider-aware free routing helps prototypes.",
    temperature: 0.2,
  });

  console.log(response.output_text);
  ```

  ```python Python SDK theme={null}
  from ai_stats import AIStats

  client = AIStats(api_key="YOUR_API_KEY")

  response = client.generate_response(
      {
          "model": "ai-stats/free",
          "input": "Summarize why provider-aware free routing helps prototypes.",
          "temperature": 0.2,
      }
  )

  print(response.get("output_text"))
  ```

  ```go Go SDK theme={null}
  package main

  import (
    "context"
    "fmt"

    aistats "github.com/AI-Stats/AI-Stats/packages/sdk/sdk-go"
  )

  func main() {
    client := aistats.New("YOUR_API_KEY", "https://api.phaseo.app/v1")

    response, err := client.GenerateResponse(context.Background(), aistats.ResponsesRequest{
      Model: "ai-stats/free",
      Input: map[string]interface{}{
        "role": "user",
        "content": []map[string]string{
          {
            "type": "input_text",
            "text": "Summarize why provider-aware free routing helps prototypes.",
          },
        },
      },
    })
    if err != nil {
      panic(err)
    }

    fmt.Println(response)
  }
  ```

  ```csharp C# SDK theme={null}
  using AiStatsSdk;
  using System.Collections.Generic;

  var client = new AIStats("YOUR_API_KEY");

  var response = await client.GenerateResponse(new Dictionary<string, object>
  {
      ["model"] = "ai-stats/free",
      ["input"] = "Summarize why provider-aware free routing helps prototypes.",
      ["temperature"] = 0.2
  });

  Console.WriteLine(response);
  ```

  ```php PHP SDK theme={null}
  <?php
  require 'vendor/autoload.php';

  use AIStats\Sdk\AIStats;

  $client = new AIStats(getenv('AI_STATS_API_KEY') ?: 'YOUR_API_KEY');

  $response = $client->generateResponse([
      'model' => 'ai-stats/free',
      'input' => 'Summarize why provider-aware free routing helps prototypes.',
      'temperature' => 0.2,
  ]);

  print_r($response);
  ```

  ```ruby Ruby SDK theme={null}
  require 'ai_stats_sdk'

  client = AIStatsSdk::AIStats.new(api_key: ENV.fetch('AI_STATS_API_KEY', 'YOUR_API_KEY'))

  response = client.generate_response(
    model: 'ai-stats/free',
    input: 'Summarize why provider-aware free routing helps prototypes.',
    temperature: 0.2
  )

  puts response
  ```
</CodeGroup>

## What happens behind the scenes

1. Your request goes to the shared `ai-stats/free` alias.
2. AI Stats checks which free models can handle that request.
3. One available free model is selected and used for the response.
4. Request details still show the exact model that ran, so you can inspect or debug it later.

## After your first request

* In **Gateway -> Usage**, open the request details and confirm which model was used.
* If the request is blocked by workspace policy, check the request details to see which setting stopped it.
* If no free model supports the feature you need, switch from `ai-stats/free` to a specific paid model instead of retrying the same request.

## Production notes

* Keep `ai-stats/free` for prototypes, demos, and low-stakes traffic.
* If you need predictable latency, output style, or provider choice, move to a specific model once you know what works best.
* If you need stable prompt behavior across services, pair this recipe with [Presets](../guides/presets).

## Related guides

* [Quickstart](../quickstart)
* [Routing and Fallbacks](../guides/routing-and-fallbacks)
* [API Errors](../api-reference/errors)
