> For a complete index of Agora Finance documentation, fetch https://docs.agora.finance/llms.txt

# Get Aggregate and Per-Chain Metrics

GET https://api.sandbox.agora.finance/v0/metrics

Returns aggregate and per-chain AUSD supply. A few response-shape details specific to this endpoint:

- **`chainId` is a [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) identifier.** Sandbox values are `eip155:11155111` (Ethereum Sepolia) and `eip155:43113` (Avalanche Fuji). Use it to cross-reference with DeFi Llama, CoinGecko, or on-chain data.
- **Aggregates are omitted on partial responses.** If one or more chains can't be reached, the response sets `partial: true` and **omits** the top-level `totalSupply` / `circulatingSupply` rather than publishing a silently-truncated figure. The omitted fields are absent — the keys are not present, not `null` — so guard with `'totalSupply' in response`, not `response.totalSupply != null`. The `chains[]` array still includes every chain with a recent cached value.
- **Supply values are decimal strings** (see the API overview for the precision convention). The plain-text variants `/v0/metrics/total-supply` and `/v0/metrics/circulating-supply` return a single decimal string when you don't need the per-chain breakdown.


Reference: https://docs.agora.finance/api/endpoints/metrics/get

## Response

### 200

Aggregate and per-chain AUSD supply breakdown. When one or more chains are temporarily unavailable, the response sets `partial: true` and omits aggregate `totalSupply` and `circulatingSupply` rather than publishing a silently-truncated figure.

- `chains` (list of V0MetricsGetResponsesContentApplicationJsonSchemaChainsItems, required) — Per-chain supply breakdown. Only chains with a currently cached successful result are included; chains that have never succeeded (or are in a persistent outage on this pod) are omitted and cause `partial` to be true.
- `partial` (boolean, required) — True when one or more chains are missing from the response (cold start before a chain's first successful fetch, or a persistent chain outage). When true, aggregate `totalSupply` and `circulatingSupply` are **omitted**, since publishing a total that silently excludes chains would look like a large supply drop to market-data consumers.
- `circulatingSupply` (string, optional) — Aggregate circulating AUSD supply across all chains, as a decimal string (e.g. `987654321.654321`). This is the sum of all per-chain circulatingSupply values. Omitted when `partial` is true.
- `totalSupply` (string, optional) — Aggregate total AUSD supply across all chains, as a decimal string (e.g. `1234567890.123456`). This is the sum of all per-chain totalSupply values. Omitted when `partial` is true.

## Errors

### 404 Not Found Error

The requested route or resource does not exist. Verify the URL and method.

- `code` (enum, required)
  - Allowed values: `not_found`
- `docs_url` (string, required)
- `message` (string, required)

### 429 Too Many Requests Error

Per-IP rate limit exceeded at the Cloudflare edge. The response includes a `Retry-After` header indicating the wait period in seconds.

- `code` (enum, required)
  - Allowed values: `rate_limit_exceeded`
- `docs_url` (string, required)
- `message` (string, required)

### 500 Internal Server Error

An unexpected server-side failure occurred. Retry with exponential backoff and capture the `Request-Id` header for support.

- `code` (enum, required)
  - Allowed values: `internal_error`
- `docs_url` (string, required)
- `message` (string, required)

## Types

### V0MetricsGetResponsesContentApplicationJsonSchemaChainsItems

- `chainId` (string, required) — CAIP-2 chain identifier (e.g. 'eip155:1' for Ethereum, 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp' for Solana). Use this for cross-referencing with DeFi Llama, CoinGecko, or on-chain data.
- `circulatingSupply` (string, required) — AUSD in public circulation on this chain (total minus premint reserves), as a decimal string (e.g. `400000000.000000`). Use this for market cap calculations and exchange integrations.
- `network` (enum, required) — Blockchain network identifier. Use this to filter or group supply data by chain. Values are stable; new networks may be added but existing ones will not be renamed.
  - Allowed values: `avalanche-fuji`, `ethereum-sepolia`
- `totalSupply` (string, required) — Total AUSD minted on this chain, as a decimal string in human-readable units (not raw on-chain units, e.g. `500000000.000000`, not `500000000000000`). Use this when you need the gross supply figure for a single chain.

## Examples

### Healthy

**Response**

```json
{
  "chains": [
    {
      "chainId": "eip155:11155111",
      "circulatingSupply": "68500000.123456",
      "network": "ethereum-sepolia",
      "totalSupply": "72100000.123456"
    },
    {
      "chainId": "eip155:43113",
      "circulatingSupply": "9450000.500000",
      "network": "avalanche-fuji",
      "totalSupply": "11400000.500000"
    }
  ],
  "partial": false,
  "circulatingSupply": "132744668.623456",
  "totalSupply": "151594669.623456"
}
```

**SDK Code**

```python Healthy
import requests

url = "https://api.sandbox.agora.finance/v0/metrics"

response = requests.get(url)

print(response.json())
```

```javascript Healthy
const url = 'https://api.sandbox.agora.finance/v0/metrics';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Healthy
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sandbox.agora.finance/v0/metrics"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Healthy
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.agora.finance/v0/metrics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java Healthy
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sandbox.agora.finance/v0/metrics")
  .asString();
```

```php Healthy
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sandbox.agora.finance/v0/metrics');

echo $response->getBody();
```

```csharp Healthy
using RestSharp;

var client = new RestClient("https://api.sandbox.agora.finance/v0/metrics");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Healthy
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.agora.finance/v0/metrics")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Partial

**Response**

```json
{
  "chains": [
    {
      "chainId": "eip155:11155111",
      "circulatingSupply": "68500000.123456",
      "network": "ethereum-sepolia",
      "totalSupply": "72100000.123456"
    }
  ],
  "partial": true
}
```

**SDK Code**

```python Partial
import requests

url = "https://api.sandbox.agora.finance/v0/metrics"

response = requests.get(url)

print(response.json())
```

```javascript Partial
const url = 'https://api.sandbox.agora.finance/v0/metrics';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Partial
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sandbox.agora.finance/v0/metrics"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Partial
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.agora.finance/v0/metrics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java Partial
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.sandbox.agora.finance/v0/metrics")
  .asString();
```

```php Partial
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.sandbox.agora.finance/v0/metrics');

echo $response->getBody();
```

```csharp Partial
using RestSharp;

var client = new RestClient("https://api.sandbox.agora.finance/v0/metrics");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Partial
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sandbox.agora.finance/v0/metrics")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```