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

# Meter Configuration

> GET /v1/meters — Query App billing meters (public endpoint)

Query the billing meter (Meter) configuration for a specified App. Meters define the mapping from event names to credit prices and serve as the basis for Events API charges.

```
GET https://api.profy.cn/v1/meters?app_uuid={app_uuid}
```

## Authentication

<Note>
  This endpoint **requires no authentication** — it is a public API. You can call it directly from the client to retrieve Meter configurations and display feature pricing to users.
</Note>

## Query Parameters

<ParamField query="app_uuid" type="string" required>
  The App's UUID. Generated when the App is created, found on the App settings page.
</ParamField>

## Request Examples

<CodeGroup>
  ```python Python theme={null}
  import httpx

  async with httpx.AsyncClient() as http:
      resp = await http.get(
          "https://api.profy.cn/v1/meters",
          params={"app_uuid": "your-app-uuid"},
      )
      meters = resp.json()["meters"]
      for m in meters:
          print(f"Event: {m['eventName']} → {m['priceCredits']} credits")
  ```

  ```typescript TypeScript theme={null}
  const resp = await fetch(
    "https://api.profy.cn/v1/meters?app_uuid=your-app-uuid"
  );
  const { meters } = await resp.json();

  for (const m of meters) {
    console.log(`Event: ${m.eventName} → ${m.priceCredits} credits`);
  }
  ```

  ```bash curl theme={null}
  curl "https://api.profy.cn/v1/meters?app_uuid=your-app-uuid"
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "meters": [
    {
      "eventName": "image_generation",
      "priceCredits": 50,
      "description": "Per image generation"
    },
    {
      "eventName": "video_render",
      "priceCredits": 200,
      "description": "Per video render"
    },
    {
      "eventName": "export_pdf",
      "priceCredits": 10,
      "description": "Per PDF export"
    }
  ]
}
```

## Meter Object

| Field          | Type             | Description                                     |
| -------------- | ---------------- | ----------------------------------------------- |
| `eventName`    | `string`         | Event name, use this value in `POST /v1/events` |
| `priceCredits` | `number`         | Credits deducted per event                      |
| `description`  | `string \| null` | Text description of the Meter                   |

<Note>
  The specific credit price for each Meter is configured by the App developer in Profy Studio. Refer to the real-time values displayed in the product.
</Note>

## Use Cases

### Display Pricing in Your App

Before users engage with paid features, call this endpoint to display credit pricing:

```typescript theme={null}
async function loadPricing(appUuid: string) {
  const resp = await fetch(
    `https://api.profy.cn/v1/meters?app_uuid=${appUuid}`
  );
  const { meters } = await resp.json();
  return new Map(meters.map((m: any) => [m.eventName, m.priceCredits]));
}

const pricing = await loadPricing("your-app-uuid");
const imagePrice = pricing.get("image_generation"); // 50
```

### Validate Event Names Before Reporting

```python theme={null}
async def report_event(client, event_name: str, idem_key: str):
    async with httpx.AsyncClient() as http:
        resp = await http.get(
            "https://api.profy.cn/v1/meters",
            params={"app_uuid": "your-app-uuid"},
        )
        valid = {m["eventName"] for m in resp.json()["meters"]}

    if event_name not in valid:
        raise ValueError(f"Unknown event: {event_name}")

    return await client.events.report(event_name, idempotency_key=idem_key)
```

## Relationship with the Events API

```
Meters API (GET)                Events API (POST)
  Query Meter config       →      Report event
  [eventName, price]              [event, idempotency_key]
                                        ↓
                                  Match Meter by eventName
                                        ↓
                                  Deduct credits per priceCredits
```

1. Configure Meters for your App in Profy Studio (event name + price)
2. Your App fetches the configuration via `GET /v1/meters` and displays pricing in the UI
3. When users use paid features, your App reports events via `POST /v1/events`
4. Profy deducts user credits based on the Meter configuration

## Error Codes

| HTTP Status Code | Description                        |
| ---------------- | ---------------------------------- |
| `400`            | Missing `app_uuid` query parameter |

## Next Steps

<CardGroup cols={2}>
  <Card title="Report Billing Events" icon="bolt" href="/en/developers/api/events">
    Report custom billing events
  </Card>

  <Card title="Build a Profy App" icon="grid-2" href="/en/developers/app-development">
    Complete App development guide
  </Card>
</CardGroup>
