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

# Network Model Presets

<Callout icon="play" color="#0037ff" iconType="regular">
  [Test the Endpoint `GET /v1/models`](/apis/get-models)
</Callout>

The `models` endpoint provides information about the available Fortytwo Network model presets. Each preset represents AI capabilities running across distributed nodes.

## List Models Endpoint

Retrieve a list of all available models that can be used for chat completions.

### Endpoint

```
GET https://api.fortytwo.network/v1/models
```

### Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.fortytwo.network/v1/models \
    -H "Authorization: Bearer YOUR_FORTYTWO_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  api_key = "YOUR_FORTYTWO_API_KEY"
  headers = {
      "Authorization": f"Bearer {api_key}"
  }

  response = requests.get(
      "https://api.fortytwo.network/v1/models",
      headers=headers
  )

  models = response.json()
  print(models)
  ```

  ```javascript JavaScript theme={null}
  const apiKey = 'YOUR_FORTYTWO_API_KEY';

  fetch('https://api.fortytwo.network/v1/models', {
    headers: {
      'Authorization': `Bearer ${apiKey}`
    }
  })
    .then(response => response.json())
    .then(data => console.log(data));
  ```
</CodeGroup>

### Response

The API returns a list of model objects in OpenAI-compatible format:

```json theme={null}
{
  "object":"list",
  "data": [
    {
      "id":"fortytwo-xxxxxxxxxxxx",
      "object":"model",
      "created":1760704134,
      "owned_by":"fortytwo"
    }
  ]
}
```

### Response Fields

<ParamField path="data" type="array">
  List of available model objects.
</ParamField>

<ParamField path="object" type="string">
  Always "list" for this endpoint.
</ParamField>

#### Model Object Fields

<ParamField path="id" type="string">
  Unique identifier for the model (use this in chat completions).
</ParamField>

<ParamField path="object" type="string">
  Always "model".
</ParamField>

<ParamField path="owned_by" type="string">
  Organization that owns or operates the model.
</ParamField>

<ParamField path="permission" type="array">
  Model permissions and capabilities.
</ParamField>

## Using Models

Once you've retrieved the list of available models, you can use any model ID in your '[Chat Completions](/docs/api-chat-completions)' requests:

<Callout icon="play" color="#0037ff" iconType="regular">
  [Test the Endpoint `POST /v1/chat/completions`](/apis/chat-completions)
</Callout>

<CodeGroup>
  ```python Python theme={null}
  # List available models
  response = requests.get(
      "https://api.fortytwo.network/v1/models",
      headers={"Authorization": f"Bearer {YOUR_FORTYTWO_API_KEY}"}
  )
  models = response.json()

  # Use a specific model
  model_id = models['data'][0]['id']

  # Make a chat completion request
  completion = requests.post(
      "https://api.fortytwo.network/v1/chat/completions",
      headers={"Authorization": f"Bearer {YOUR_FORTYTWO_API_KEY}"},
      json={
          "model": model_id,
          "messages": [
              {"role": "user", "content": "Hello!"}
          ]
      }
  )
  ```

  ```javascript JavaScript theme={null}
  // List available models
  const response = await fetch("https://api.fortytwo.network/v1/models", {
    headers: {
      "Authorization": `Bearer ${YOUR_FORTYTWO_API_KEY}`
    }
  });
  const models = await response.json();

  // Use a specific model
  const model_id = models.data[0].id;

  // Make a chat completion request
  const completion = await fetch("https://api.fortytwo.network/v1/chat/completions", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${YOUR_FORTYTWO_API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: model_id,
      messages: [
        { role: "user", content: "Hello!" }
      ]
    })
  });
  ```
</CodeGroup>

## OpenAI Compatibility

The Models endpoint is fully compatible with OpenAI's models API format. You can use the same client libraries and code:

<CodeGroup>
  ```python Python theme={null}
  from openai import OpenAI

  # Point to Fortytwo API
  client = OpenAI(
      api_key="YOUR_FORTYTWO_API_KEY",
      base_url="https://api.fortytwo.network/v1"
  )

  # List models (same as OpenAI)
  models = client.models.list()
  for model in models.data:
      print(f"Model: {model.id}")
  ```

  ```javascript JavaScript theme={null}
  import OpenAI from "openai";

  // Point to Fortytwo API
  const client = new OpenAI({
    apiKey: "YOUR_FORTYTWO_API_KEY",
    baseURL: "https://api.fortytwo.network/v1"
  });

  // List models (same as OpenAI)
  const models = await client.models.list();
  for (const model of models.data) {
    console.log(`Model: ${model.id}`);
  }
  ```
</CodeGroup>

## Next Steps

* Learn how to use models in '[Chat Completions](/docs/api-chat-completions)'.
* Understand '[Preview Limits & Quotas](/docs/api-rate-limits)' for API usage.
