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

# Quickstart

> Authenticate with an API key, list devices, and invoke a function.

# Quickstart

Get from zero to an invoked device function in a few curls.

<Tip>
  Create an API key in the dashboard under **API keys**, then come back here with `$ORQUESTR_API_KEY`.
</Tip>

## 1. API key

Export your key and base URL:

```bash theme={"system"}
export API=https://api.orquestr.dev/cloud
export ORQUESTR_API_KEY="sk_live_…"   # account API key
export CUSTOMER_ID="…"                 # customer UUID
```

Send it on every request:

```http theme={"system"}
Authorization: Bearer $ORQUESTR_API_KEY
```

## 2. List devices

```bash theme={"system"}
curl -s "$API/v1/devices?customer_id=$CUSTOMER_ID" \
  -H "Authorization: Bearer $ORQUESTR_API_KEY"
```

Response: `{ data: Device[], meta }`. Results respect the API key’s optional customer / license / device filters.

## 3. List functions for a device

```bash theme={"system"}
curl -s "$API/v1/devices/$DEVICE_ID/functions" \
  -H "Authorization: Bearer $ORQUESTR_API_KEY"
```

Response: `{ data: Function[], meta }` (`meta` includes `device_id` and `adapter`).

## 4. Invoke (example: product search)

```bash theme={"system"}
curl -s -X POST \
  "$API/v1/devices/$DEVICE_ID/functions/sicarv4.products.search" \
  -H "Authorization: Bearer $ORQUESTR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "q": "coca 600",
      "status": "1",
      "servicio": "0",
      "existencia_op": "gte",
      "existencia": "1",
      "limit": "50"
    }
  }'
```

The device must be **enrolled** and online via the Gateway. Response is `{ "data": { device_id, function_id, operation, result } }` — `result` is the agent payload (rows / error).

<CardGroup cols={2}>
  <Card title="All SICAR V4 functions" icon="database" href="/functions/adapters/sicarv4/overview">
    Full catalog with parameters and examples.
  </Card>

  <Card title="API reference" icon="key" href="/api/introduction">
    How to authenticate and call the Cloud API.
  </Card>
</CardGroup>
