> This page is for API Reference.

> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> Building a voice agent for customers in India? Start with Sarvam Voice Agents, a managed platform with Indian-language speech, telephony, testing, and analytics from ₹3 per minute: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# List Models V2

GET https://api.sarvam.ai/v2/models

Lists the model IDs available for the V2 Chat Completion API.

Reference: https://docs.sarvam.ai/api-reference/chat/models-v2

## Authentication

- `api-subscription-key` header (required) — API Key authentication via header
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Response

### 200

Successful Response

- `data` (list of ModelObject, required)
- `object` ("list", optional, default: list)

## Types

### ModelObject

- `id` (string, required)
- `created` (integer, required)
- `owned_by` (string, required)
- `object` ("model", optional, default: model)

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "glm5.3",
      "created": 0,
      "owned_by": "open-source",
      "object": "model"
    },
    {
      "id": "gemma4",
      "created": 0,
      "owned_by": "open-source",
      "object": "model"
    },
    {
      "id": "sarvam-105b",
      "created": 0,
      "owned_by": "sarvam",
      "object": "model"
    },
    {
      "id": "deepseekv4.1-flash",
      "created": 0,
      "owned_by": "open-source",
      "object": "model"
    }
  ],
  "object": "list"
}
```

**SDK Code**

```python Chat Completion_list_models_v2_example
import requests

url = "https://api.sarvam.ai/v2/models"

headers = {"api-subscription-key": "<apiSubscriptionKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Chat Completion_list_models_v2_example
const url = 'https://api.sarvam.ai/v2/models';
const options = {method: 'GET', headers: {'api-subscription-key': '<apiSubscriptionKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Chat Completion_list_models_v2_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sarvam.ai/v2/models"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api-subscription-key", "<apiSubscriptionKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Chat Completion_list_models_v2_example
require 'uri'
require 'net/http'

url = URI("https://api.sarvam.ai/v2/models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["api-subscription-key"] = '<apiSubscriptionKey>'

response = http.request(request)
puts response.read_body
```

```java Chat Completion_list_models_v2_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sarvam.ai/v2/models")
  .header("api-subscription-key", "<apiSubscriptionKey>")
  .asString();
```

```php Chat Completion_list_models_v2_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sarvam.ai/v2/models', [
  'headers' => [
    'api-subscription-key' => '<apiSubscriptionKey>',
  ],
]);

echo $response->getBody();
```

```csharp Chat Completion_list_models_v2_example
using RestSharp;

var client = new RestClient("https://api.sarvam.ai/v2/models");
var request = new RestRequest(Method.GET);
request.AddHeader("api-subscription-key", "<apiSubscriptionKey>");
IRestResponse response = client.Execute(request);
```

```swift Chat Completion_list_models_v2_example
import Foundation

let headers = ["api-subscription-key": "<apiSubscriptionKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sarvam.ai/v2/models")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```