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

# Inicio rápido

> Tu primera llamada al API de AFK Crypto

## Empieza en 4 pasos

Crea una cuenta, habilita la automatización, genera una clave de API y realiza tu primera solicitud.

### Paso 1: Inicia sesión

<AccordionGroup>
  <Accordion icon="user" title="Inicia sesión en tu cuenta">
    Ingresa en <a href="https://app.afkcrypto.com">app.afkcrypto.com</a>.
  </Accordion>
</AccordionGroup>

### Paso 2: Habilita la automatización (Billeteras)

<AccordionGroup>
  <Accordion icon="toggle-on" title="Permite que AFK firme por ti (sin custodia)">
    En la página <a href="https://app.afkcrypto.com/wallets">Wallets</a>, activa Automation para tu dirección. Esto permite que AFK firme transacciones para flujos automatizados usando firma no custodial basada en sesiones. Puedes revocarlo en cualquier momento.
  </Accordion>
</AccordionGroup>

### Paso 3: Crea la clave de API (automatización de billeteras)

<AccordionGroup>
  <Accordion icon="key" title="Crea una clave de API">
    En <a href="https://app.afkcrypto.com/api-keys">API Keys</a> del panel, crea una clave para automatización de billeteras.

    * Encabezado: `x-api-key: afk_<prefix>_<random>`
    * Manténla en secreto; rota si se ve comprometida

    Consulta <a href="/api-reference/authentication/">Autenticación</a> para más detalles.
  </Accordion>
</AccordionGroup>

### Paso 4: Realiza llamadas al API

<AccordionGroup>
  <Accordion icon="list" title="Listar billeteras">
    Define tu clave de API en una variable de entorno para reutilizar:

    ```bash theme={null}
    export AFK_API_KEY="afk_abcd_xxx"
    ```

    ```bash theme={null}
    curl -s -H "x-api-key: $AFK_API_KEY" \
      "https://api.afkcrypto.com/v1/wallets?chain=ethereum"
    ```

    ```json theme={null}
    {
      "wallets": [
        {
          "address": "0xabc...",
          "chainType": "ethereum",
          "isDefault": true,
          "automationEnabled": true,
          "providerType": "embedded",
          "clientType": "privy"
        }
      ]
    }
    ```
  </Accordion>

  <Accordion icon="paper-plane" title="Enviar un activo (idempotente)">
    Proporciona `Idempotency-Key: <uuid>` en todos los endpoints de escritura.

    ```bash theme={null}
    curl -s -X POST https://api.afkcrypto.com/v1/send \
      -H "x-api-key: $AFK_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "chain":"base-sepolia",
        "asset":"erc20",
        "token":"0xToken",
        "to":"0xRecipient",
        "amount":"1000000000000000000"
      }'
    ```

    ```json theme={null}
    { "id": "tx_...", "status": "SUBMITTED", "hash": "0x...", "explorerUrl": "https://basescan.org/tx/0x...", "chainName": "Base" }
    ```
  </Accordion>

  <Accordion icon="bolt" title="Interactuar con contratos (EVM)">
    ```bash theme={null}
    curl -s -X POST https://api.afkcrypto.com/v1/contracts/send \
      -H "x-api-key: $AFK_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "chain":"base-sepolia",
        "to":"0xContract",
        "data":"0xabcdef...",
        "value":"0"
      }'
    ```
  </Accordion>

  <Accordion icon="circle-nodes" title="Enviar token SPL (Solana)">
    ```bash theme={null}
    curl -s -X POST https://api.afkcrypto.com/v1/send \
      -H "x-api-key: $AFK_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
        "chain":"solana-devnet",
        "asset":"spl",
        "token":"MintAddress",
        "to":"RecipientOwnerAddress",
        "amount":"1000000"
      }'
    ```
  </Accordion>

  <Accordion icon="receipt" title="Consultar transacción">
    ```bash theme={null}
    curl -s -H "x-api-key: $AFK_API_KEY" \
      "https://api.afkcrypto.com/v1/tx/tx_cuid_here"
    ```

    ```json theme={null}
    {
      "id":"tx_cuid_here",
      "status":"PENDING",
      "hash": null,
      "explorerUrl": null,
      "chainName":"Base",
      "chainType":"ethereum",
      "chainId":8453,
      "to":"0xrecipient...",
      "value":"1000000000000000",
      "error": null,
      "createdAt":"2025-08-25T08:00:00.000Z",
      "updatedAt":"2025-08-25T08:00:00.000Z"
    }
    ```
  </Accordion>
</AccordionGroup>

## Próximos pasos

Explora los endpoints principales:

<CardGroup cols={2}>
  <Card title="Enviar activo" icon="paper-plane" href="/api-reference/endpoint/send/">
    Transfiere activos nativos y tokens.
  </Card>

  <Card title="Aprobar tokens" icon="key" href="/api-reference/endpoint/token-approve/">
    Aprueba asignaciones de ERC20.
  </Card>

  <Card title="Comercio" icon="right-left" href="/api-reference/endpoint/trade-quote/">
    Solicita cotizaciones y ejecuta swaps.
  </Card>

  <Card title="Documentación API" icon="code" href="/api-reference/introduction/">
    Explora endpoints y convenciones.
  </Card>
</CardGroup>

<Note>
  **¿Necesitas ayuda?** Escribe a <a href="mailto:hello@afkcrypto.com">[hello@afkcrypto.com](mailto:hello@afkcrypto.com)</a> o contáctanos en <a href="https://twitter.com/afkcryptoai">Twitter</a>.
</Note>
