> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.meshapi.ai/api-reference/mesh-api/models/llms.txt.
> For full documentation content, see https://developers.meshapi.ai/api-reference/mesh-api/models/llms-full.txt.

# List free models

GET https://api.meshapi.ai/v1/models/free

Shortcut for `GET /v1/models?free=true`.

Reference: https://developers.meshapi.ai/api-reference/mesh-api/models/list-free-models

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi
  version: 1.0.0
paths:
  /v1/models/free:
    get:
      operationId: list-free-models
      summary: List free models
      description: Shortcut for `GET /v1/models?free=true`.
      tags:
        - subpackage_models
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Free models only.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModelInfo'
        '401':
          description: Missing, malformed, or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: The bearer token is valid but not currently active.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
servers:
  - url: https://api.meshapi.ai
components:
  schemas:
    ModelPricing:
      type: object
      properties:
        prompt_usd_per_1k:
          type:
            - string
            - 'null'
        completion_usd_per_1k:
          type:
            - string
            - 'null'
        image_usd_per_image:
          type:
            - string
            - 'null'
        discount_pct:
          type:
            - string
            - 'null'
        prompt_usd_per_1k_discounted:
          type:
            - string
            - 'null'
        completion_usd_per_1k_discounted:
          type:
            - string
            - 'null'
      title: ModelPricing
    ModelInfo:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        context_length:
          type:
            - integer
            - 'null'
        is_free:
          type: boolean
        pricing:
          $ref: '#/components/schemas/ModelPricing'
        description:
          type:
            - string
            - 'null'
      required:
        - id
        - name
        - is_free
        - pricing
      title: ModelInfo
    ErrorBodyCode:
      type: string
      enum:
        - unauthorized
        - forbidden
        - not_found
        - model_not_found
        - validation_error
        - unprocessable_entity
        - rate_limit_exceeded
        - spend_limit_exceeded
        - conflict
        - upstream_error
        - provider_not_available
        - gateway_timeout
      title: ErrorBodyCode
    ValidationErrorDetailLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorDetailLocItems
    ValidationErrorDetail:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorDetailLocItems'
        msg:
          type: string
        type:
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationErrorDetail
    ProviderError:
      type: object
      properties:
        provider:
          type: string
        status:
          type:
            - integer
            - 'null'
        message:
          type:
            - string
            - 'null'
      title: ProviderError
    ErrorBody:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorBodyCode'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        details:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ValidationErrorDetail'
        provider_error:
          oneOf:
            - $ref: '#/components/schemas/ProviderError'
            - type: 'null'
        retry_after_seconds:
          type:
            - integer
            - 'null'
      required:
        - code
        - message
      title: ErrorBody
    ErrorEnvelope:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
        request_id:
          type: string
      required:
        - error
        - request_id
      title: ErrorEnvelope
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

```

## SDK Code Examples

```typescript TypeScript (SDK)
import { MeshAPI } from "meshapi-node-sdk";

const client = new MeshAPI({
  baseUrl: "https://api.meshapi.ai",
  token: "rsk_01JXXXXXXXXXXXXXXXXXXXXXXX",
});

const models = await client.models.free();
console.log(models.map((model) => model.id));

```

```python Python (SDK)
from meshapi import MeshAPI

client = MeshAPI(
  base_url="https://api.meshapi.ai",
  token="rsk_01JXXXXXXXXXXXXXXXXXXXXXXX",
)

models = client.models.free()
print([model.id for model in models])

```

```go Go (SDK)
package main

import (
  "context"
  "fmt"
  "log"

  meshapi "meshapi-go-sdk"
)

func main() {
  client := meshapi.New(meshapi.Config{
    BaseURL: "https://api.meshapi.ai",
    Token:   "rsk_01JXXXXXXXXXXXXXXXXXXXXXXX",
  })

  models, err := client.Models.Free(context.Background())
  if err != nil {
    log.Fatal(err)
  }

  fmt.Println(models[0].ID)
}

```

```java Java (SDK)
import com.meshapi.sdk.MeshAPI;
import com.meshapi.sdk.types.models.ModelInfo;
import java.util.List;

MeshAPI client = MeshAPI.builder()
    .baseUrl("https://api.meshapi.ai")
    .token("rsk_01JXXXXXXXXXXXXXXXXXXXXXXX")
    .build();

List<ModelInfo> models = client.models().free();
System.out.println(models.get(0).id);

```

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

url = URI("https://api.meshapi.ai/v1/models/free")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.meshapi.ai/v1/models/free', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.meshapi.ai/v1/models/free");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.meshapi.ai/v1/models/free")! 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()
```