> ## 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.

# मॉडल खोज (AI SDK)

> AI SDK provider के साथ उपयोग के लिए मौजूदा मॉडल ID कैसे प्राप्त करें।

Vercel AI SDK provider में बिल्ट-इन `listModels()` helper नहीं है। मॉडल ID को अद्यतन रखने के लिए इनमें से कोई तरीका अपनाएँ।

## विकल्प 1: Gateway API से प्राप्त करें

```ts theme={null}
const response = await fetch("https://api.phaseo.app/v1/models", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.PHASEO_API_KEY}`,
  },
});

const filteredResponse = await fetch(
  "https://api.phaseo.app/v1/models?provider=anthropic&status=active,deprecated&availability=all",
  {
    headers: {
      Authorization: `Bearer ${process.env.PHASEO_API_KEY}`,
    },
  },
);

if (!response.ok || !filteredResponse.ok) {
  throw new Error("Failed to load models");
}

const models = await response.json();
const filteredModels = await filteredResponse.json();
console.log(models, filteredModels);
```

## विकल्प 2: आधिकारिक TypeScript SDK का उपयोग करें

```ts theme={null}
import Phaseo from "@phaseo/sdk";

const client = new Phaseo({ apiKey: process.env.PHASEO_API_KEY! });
const models = await client.getModels({
  provider: ["anthropic"],
  status: ["active", "deprecated"],
  availability: "all",
});

console.log(models);
```

## AI SDK के साथ खोजे गए ID का उपयोग

```ts theme={null}
import { phaseo } from "@phaseo/ai-sdk-provider";
import { generateText } from "ai";

const result = await generateText({
  model: phaseo("openai/gpt-5-nano"),
  prompt: "Hello from a discovered model ID.",
});

console.log(result.text);
```

## नोट्स

* मॉडल ID का प्रारूप `provider/model` होता है।
* `/v1/models` में `provider`, `status`, `organisation`, `endpoints` और `availability` जैसे फ़िल्टर उपलब्ध हैं।
* रूटिंग बदलाव और deprecated मॉडल देखने के लिए उपलब्धता समय-समय पर फिर जाँचें।
* मॉडल ID को लंबे समय तक कोड में लिखने के बजाय `/v1/models` से चुनें।


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