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

# Calling functions

> Call a saved Function over HTTP, pass parameters, and read its return value.

You need a saved Function, a valid [Access Key](/guides/openapi/authentication), and available OpenAPI units. Follow [Create a Function](/guides/functions/create) to create `demo.usdc_amount` and confirm in the console that input `1500000` returns `1.5`.

## Request format

```text theme={null}
POST https://openapi.chaintable.com/v1/function/{function_id}
```

| Part                  | Content                                                          |
| --------------------- | ---------------------------------------------------------------- |
| `function_id`         | Full Function ID, such as `demo.usdc_amount`                     |
| `AccessKey` header    | Access Key for the owning account                                |
| `Content-Type` header | `application/json`                                               |
| `parameters`          | JSON array in function-argument order; use `[]` for no arguments |

```bash theme={null}
curl -X POST 'https://openapi.chaintable.com/v1/function/demo.usdc_amount' \
  -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"parameters": [1500000]}'
```

`parameters` is a positional argument list, not an object keyed by parameter names. For `_(address, block_id)`, pass the address followed by the block ID.

## Read the result

Responses contain `code`, `message`, and `data`. The request above returns HTTP `200` on success, with `code: "success"` and the function's return value in `data`:

```json theme={null}
{
  "code": "success",
  "message": "ok",
  "data": 1.5
}
```

Install `requests` in your Python application environment, then check both the HTTP status and response `code`:

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

response = requests.post(
    'https://openapi.chaintable.com/v1/function/demo.usdc_amount',
    headers={'AccessKey': os.environ['CHAINTABLE_ACCESS_KEY']},
    json={'parameters': [1500000]},
    timeout=10,
)
body = response.json()
if not response.ok or body['code'] != 'success':
    raise RuntimeError(f"{body['code']}: {body['message']}")
print(body['data'])
```

The script prints `1.5`.

## Call other Functions

Replace the full Function ID in the path and adjust `parameters` to match its definition.

After completing [Get address ETH balance](/quickstart/use/query-wallet-eth-balance), call the saved `demo.wallet_eth_value` from your application:

```bash theme={null}
curl -X POST 'https://openapi.chaintable.com/v1/function/demo.wallet_eth_value' \
  -H "AccessKey: $CHAINTABLE_ACCESS_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"parameters": ["0xd8da6bf26964af9d7eed9e03e53415d37aa96045"]}'
```

On success, `data` contains the address, ETH balance, block ID, ETH price, and USD value.
