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

# Quickstart

> Haz tu primera llamada API en 5 minutos

## 1. Obtén tu API Key

Accede al [Panel de LINA](https://app.linahealthcareplatform.com) → **Configuración** → **API Keys** y genera una nueva clave.

```bash theme={null}
# Tu API Key tiene este formato:
lina_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

<Warning>
  Tu API Key es secreta. No la expongas en código del lado del cliente ni la incluyas en repositorios públicos.
</Warning>

## 2. Obtén un token de acceso

Intercambia tu API Key por un token JWT de corta duración:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.linahealthcareplatform.com/api/v1/auth/token \
    -H "Content-Type: application/json" \
    -d '{"apiKey": "lina_sk_xxxxxxxxxxxx"}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.linahealthcareplatform.com/api/v1/auth/token", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ apiKey: "lina_sk_xxxxxxxxxxxx" })
  });

  const { accessToken } = await response.json();
  ```

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

  response = requests.post(
      "https://api.linahealthcareplatform.com/api/v1/auth/token",
      json={"apiKey": "lina_sk_xxxxxxxxxxxx"}
  )

  access_token = response.json()["accessToken"]
  ```
</CodeGroup>

Respuesta:

```json theme={null}
{
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "expiresIn": 3600,
  "tokenType": "Bearer"
}
```

## 3. Haz tu primera petición

Usa el token para listar tus pacientes:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.linahealthcareplatform.com/api/v1/patients \
    -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
  ```

  ```javascript Node.js theme={null}
  const patients = await fetch("https://api.linahealthcareplatform.com/api/v1/patients", {
    headers: { "Authorization": `Bearer ${accessToken}` }
  }).then(r => r.json());

  console.log(patients.data);
  ```

  ```python Python theme={null}
  response = requests.get(
      "https://api.linahealthcareplatform.com/api/v1/patients",
      headers={"Authorization": f"Bearer {access_token}"}
  )

  patients = response.json()["data"]
  ```
</CodeGroup>

## 4. Siguiente paso

<CardGroup cols={2}>
  <Card title="Autenticación" icon="lock" href="/authentication">
    Aprende sobre permisos y scopes
  </Card>

  <Card title="Créditos" icon="coins" href="/credits">
    Entiende el consumo de créditos via API
  </Card>
</CardGroup>
