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

# 从免费路由器开始

> 先使用 phaseo/free 运行首次集成，无需提前选定某一个免费模型。

按照本指南运行你的第一个 Phaseo 集成，无需现在就选择付费模型。

你可以将请求发送到 `phaseo/free`，而不是自行选择一个免费模型。Phaseo 会从可用的免费模型中选择一个来处理当前请求。

## 请求示例

<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": "phaseo/free",
      "input": "Summarize why provider-aware free routing helps prototypes.",
      "temperature": 0.2
    }'
  ```

  ```typescript TypeScript SDK theme={null}
  import Phaseo from "@phaseo/sdk";

  const client = new Phaseo({ apiKey: process.env.PHASEO_API_KEY! });

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

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

  ```python Python SDK theme={null}
  from phaseo import Phaseo

  client = Phaseo(api_key="YOUR_API_KEY")

  response = client.generate_response(
      {
          "model": "phaseo/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"

    phaseo "github.com/phaseoteam/Phaseo/packages/sdk/sdk-go/v3"
  )

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

    response, err := client.GenerateResponse(context.Background(), phaseo.ResponsesRequest{
      Model: "phaseo/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 PhaseoSdk;
  using System.Collections.Generic;

  var client = new Phaseo("YOUR_API_KEY");

  var response = await client.GenerateResponse(new Dictionary<string, object>
  {
      ["model"] = "phaseo/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 Phaseo\Sdk\Phaseo;

  $client = new Phaseo(getenv('PHASEO_API_KEY') ?: 'YOUR_API_KEY');

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

  print_r($response);
  ```

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

  client = PhaseoSdk::Phaseo.new(api_key: ENV.fetch('PHASEO_API_KEY', 'YOUR_API_KEY'))

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

  puts response
  ```
</CodeGroup>

## 后台处理流程

1. 请求会发送到共享别名 `phaseo/free`。
2. Phaseo 会检查哪些免费模型可以处理该请求。
3. 系统会选择一个可用的免费模型来生成响应。
4. 请求详情仍会显示实际运行的确切模型，方便你之后检查或调试。

## 首次请求之后

* 在 **Gateway -> 用量** 中打开请求详情，确认使用了哪个模型。
* 如果工作区策略阻止了请求，请查看请求详情，了解是哪项设置导致拦截。
* 如果没有免费模型支持所需功能，请改用某个具体的付费模型，而不要反复重试同一请求。

## 生产环境说明

* 将 `phaseo/free` 用于原型、演示和低风险流量。
* 如果需要可预测的延迟、输出风格或提供商选择，请在确定最合适的模型后切换到该模型。
* 如果需要不同服务间保持稳定的提示词行为，请将本指南与[预设](../guides/presets.mdx)配合使用。

## 相关指南

* [快速入门](../quickstart.mdx)
* [路由与回退](../guides/routing-and-fallbacks.mdx)
* [API 错误](../api-reference/errors.mdx)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.