# Αναφορά API: Χρεώσεις

Χρεώσεις: όλες οι λειτουργίες του API v1 με το απαιτούμενο scope, τις παραμέτρους, παραδείγματα σε curl, JavaScript και Python και τις απαντήσεις. Η ταυτοποίηση, τα σφάλματα, η σελιδοποίηση, τα όρια και η αυτοδυναμία περιγράφονται στην [επισκόπηση της αναφοράς API](/docs/api-reference)· δείτε και τα [SDK](/docs/sdks) και τη [γραμμή εντολών](/docs/cli).

> Δοκιμάστε το με το κλειδί σας: δημιουργήστε ένα κλειδί API στην κονσόλα, εκτελέστε `export APIDLY_API_KEY=...` στο τερματικό και επικολλήστε οποιοδήποτε παράδειγμα curl παρακάτω. Οι τιμές των παραδειγμάτων είναι ενδεικτικές. Σε αυτή τη σελίδα δεν υπάρχει πεδίο για εισαγωγή κλειδιού.

Οι περιγραφές των λειτουργιών και των πεδίων προέρχονται από τον ορισμό του API και είναι στα αγγλικά.

| Λειτουργία | Απαιτούμενο scope | Περίληψη |
| --- | --- | --- |
| `GET /balance` | `read` | Υπόλοιπο, ρυθμός κατανάλωσης και αυτονομία |
| `GET /ledger` | `read` | Πιστώσεις και χρεώσεις, οι νεότερες πρώτα |
| `GET /invoices` | `read` | Τιμολόγια, αποδείξεις και καταστάσεις, τα νεότερα πρώτα |
| `GET /usage` | `read` | Χρεώσεις ανά διακομιστή ή ανά ημέρα |
| `POST /topups` | `full` | Έναρξη φιλοξενούμενης πληρωμής για προσθήκη πίστωσης |
| `GET /billing/topup-bonus` | `read` | Κλίμακες μπόνους επαναφόρτισης |
| `GET /budget` | `read` | Μηνιαίος προϋπολογισμός, επίπεδα ειδοποίησης και δαπάνες αυτού του μήνα |
| `PUT /budget` | `full` | Αλλαγή του προϋπολογισμού |
| `POST /billing/promo` | `full` | Εξαργύρωση κωδικού προσφοράς |
| `GET /billing/summary` | `read` | Σύνοψη χρέωσης: υπόλοιπο, αυτόματη φόρτιση, προεπιλεγμένη κάρτα, συνδρομή και όρια φόρτισης |
| `PATCH /billing/auto-topup` | `full` | Απενεργοποίηση αυτόματης επαναφόρτισης |
| `GET /billing/details` | `read` | Όνομα χρέωσης, διεύθυνση και φορολογικό αναγνωριστικό |
| `PUT /billing/details` | `full` | Αποθήκευση των στοιχείων χρέωσης |
| `GET /statements` | `read` | Μηνιαίες καταστάσεις, οι νεότερες πρώτα |
| `GET /statements/{month}` | `read` | Η κατάσταση ενός μήνα με σύνολα, διακομιστές και τόμους |
| `GET /ledger/{id}/receipt` | `read` | Απόδειξη πληρωμής (PDF) μιας αναπλήρωσης |
| `GET /budget/status` | `read` | Δαπάνες αυτού του μήνα σε σχέση με τον προϋπολογισμό |
| `GET /invoices/{id}` | `read` | Ένα τιμολόγιο ως σελίδα για εκτύπωση |
| `GET /servers/{id}/billing` | `read` | Πόσο κόστισε ένας διακομιστής |
| `GET /billing/export` | `read` | Χρήση ή καθολικό ως αρχείο CSV |
| `POST /billing/refund-requests` | `full` | Αίτημα επιστροφής χρημάτων |

### GET /balance

Υπόλοιπο, ρυθμός κατανάλωσης και αυτονομία

**Απαιτούμενο scope:** `read`

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/balance" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.balance();
```

**Python (SDK)**

```python
client.billing.balance()
```

**Εργαλείο γραμμής εντολών:** `apidly balance` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "balance": {
    "balanceMicros": "1000000",
    "balanceUsd": "1.000000",
    "burnPerHourMicros": "1000000",
    "burnPerHourUsd": "1.000000",
    "runwayHours": 1,
    "state": "ok",
    "graceUntil": "2026-11-21T10:00:00.000Z",
    "monthToDateMicros": "1000000",
    "monthToDateUsd": "1.000000"
  }
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### GET /ledger

Πιστώσεις και χρεώσεις, οι νεότερες πρώτα

Optional filters: `type`, `from` (inclusive) and `to` (exclusive) as a date or date-time, and `serverId` for the charges and credits of one server. Repeat the same filters on every page so the `cursor` stays valid.

**Απαιτούμενο scope:** `read`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | όχι |  |
| `cursor` | query | string | όχι |  |
| `from` | query | string | όχι |  |
| `to` | query | string | όχι |  |
| `serverId` | query | string | όχι |  |
| `type` | query | `topup` \| `usage` \| `refund` \| `adjustment` \| `subscription_credit` \| `promo` | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/ledger?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.listLedger({ limit: 20 });
```

**Python (SDK)**

```python
client.billing.list_ledger()
```

**Εργαλείο γραμμής εντολών:** `apidly ledger` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "entries": [
    {
      "id": "example",
      "type": "topup",
      "amountMicros": "1000000",
      "amountUsd": "1.000000",
      "balanceAfterMicros": "1000000",
      "balanceAfterUsd": "1.000000",
      "description": "example",
      "instanceId": "id_example",
      "createdAt": "2026-11-21T10:00:00.000Z"
    }
  ],
  "nextCursor": "example"
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### GET /invoices

Τιμολόγια, αποδείξεις και καταστάσεις, τα νεότερα πρώτα

Optional filters: `kind`, and `from` (inclusive) and `to` (exclusive) as a date or date-time. Repeat the same filters on every page so the `cursor` stays valid.

**Απαιτούμενο scope:** `read`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | όχι |  |
| `cursor` | query | string | όχι |  |
| `kind` | query | `topup` \| `subscription` \| `statement` | όχι |  |
| `from` | query | string | όχι |  |
| `to` | query | string | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/invoices?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.listInvoices({ limit: 20 });
```

**Python (SDK)**

```python
client.billing.list_invoices()
```

**Εργαλείο γραμμής εντολών:** `apidly invoices` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "invoices": [
    {
      "id": "example",
      "kind": "topup",
      "number": "example",
      "amountCents": 1,
      "currency": "example",
      "status": "paid",
      "hostedUrl": "https://example.com/hook",
      "pdfUrl": "https://example.com/hook",
      "periodStart": "2026-11-21T10:00:00.000Z",
      "periodEnd": "2026-11-21T10:00:00.000Z",
      "createdAt": "2026-11-21T10:00:00.000Z"
    }
  ],
  "nextCursor": "example"
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### GET /usage

Χρεώσεις ανά διακομιστή ή ανά ημέρα

`groupBy` is `instance` (default), `day` (UTC), `gpu`, `member` (who requested the server), `template`, `tag` or `apiKey` (the API key the server was launched with; `key` is the key id and `label` its name, kept after the key is revoked; servers launched without a key, from the console, a schedule or a group, have the key `none`). Under `tag` a server with several tags appears under each of them and untagged spend has the key `none`, so rows can add up to more than `totalMicros`, which counts every charge once. `serverId` (with `instance` or `day` only, else 400 `invalid_query`) keeps just that server's compute and disk charges: `groupBy=day&serverId=...` is one server's charges per UTC day. Volume charges belong to no server and are left out then.

**Απαιτούμενο scope:** `read`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | όχι |  |
| `cursor` | query | string | όχι |  |
| `from` | query | string | όχι |  |
| `to` | query | string | όχι |  |
| `groupBy` | query | `instance` \| `day` \| `gpu` \| `member` \| `template` \| `tag` \| `apiKey` | όχι |  |
| `serverId` | query | string | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/usage?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.usage({ limit: 20 });
```

**Python (SDK)**

```python
client.billing.usage()
```

**Εργαλείο γραμμής εντολών:** `apidly usage` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "from": "2026-11-21T10:00:00.000Z",
  "to": "2026-11-21T10:00:00.000Z",
  "groupBy": "example",
  "serverId": "id_example",
  "rows": [
    {
      "key": "example",
      "label": "example",
      "tags": [
        "example"
      ],
      "destroyed": false,
      "computeMicros": "1000000",
      "computeUsd": "1.000000",
      "computeSeconds": 1,
      "storageMicros": "1000000",
      "storageUsd": "1.000000",
      "storageSeconds": 1,
      "volumeMicros": "1000000",
      "volumeUsd": "1.000000",
      "volumeSeconds": 1,
      "isVolume": false,
      "totalMicros": "1000000",
      "totalUsd": "1.000000"
    }
  ],
  "nextCursor": "example",
  "totalMicros": "1000000",
  "totalUsd": "1.000000"
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `429`.

### POST /topups

Έναρξη φιλοξενούμενης πληρωμής για προσθήκη πίστωσης

Returns a checkout URL to open in a browser. `acceptTerms: true` is the same express request and acknowledgement the console asks for. The API never charges a saved card.

**Απαιτούμενο scope:** `full` · **Ασφαλής επανάληψη με:** `Idempotency-Key`

**Σώμα αιτήματος**

| Όνομα | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- |
| `amountCents` | integer | ναι |  |
| `acceptTerms` | `true` | ναι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/topups" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amountCents":2500,"acceptTerms":true}'
```

**JavaScript (SDK)**

```js
await apidly.billing.topup({
  amountCents: 2500,
  acceptTerms: true
});
```

**Python (SDK)**

```python
client.billing.topup(amount_cents=2500, accept_terms=True)
```

**Εργαλείο γραμμής εντολών:** `apidly topup` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (201)

```json
{
  "topup": {
    "amountCents": 1,
    "checkoutUrl": "https://example.com/hook"
  }
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `422`, `429`.

### GET /billing/topup-bonus

Κλίμακες μπόνους επαναφόρτισης

The promotional credit a paid top-up earns: the bonus of the highest tier whose `minCents` is at most the amount paid. On the organization's first successful paid top-up of at least `firstPaymentMinCents` a fixed `firstPaymentExtraCents` is added on top, once per organization (and not again for a card that already earned it on another organization). The amount charged never changes. Promotional credit is used for servers like any credit but is never refunded, transferred or paid out; the bonus of a refunded or disputed payment is taken back (only what is unspent). Answers 404 `feature_unavailable` while the top-up bonus is not offered.

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/billing/topup-bonus" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.topupBonus();
```

**Python (SDK)**

```python
client.billing.topup_bonus()
```

**Εργαλείο γραμμής εντολών:** `apidly billing` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "topupBonus": {
    "firstPayment": false,
    "firstPaymentExtraCents": 1,
    "firstPaymentMinCents": 1,
    "tiers": [
      {
        "minCents": 1,
        "bonusCents": 1
      }
    ]
  }
}
```

Καταστάσεις σφάλματος: `401`, `403`, `404`, `429`.

### GET /budget

Μηνιαίος προϋπολογισμός, επίπεδα ειδοποίησης και δαπάνες αυτού του μήνα

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/budget" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.budget.get();
```

**Python (SDK)**

```python
client.budget.get()
```

**Εργαλείο γραμμής εντολών:** `apidly budget` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "monthlyBudgetMicros": "1000000",
  "monthlyBudgetUsd": "1.000000",
  "alertThresholds": [
    1
  ],
  "hardStop": false,
  "lowBalanceThresholdMicros": "1000000",
  "lowBalanceThresholdUsd": "1.000000",
  "level": "none",
  "month": "example",
  "percent": 1,
  "spentMicros": "1000000",
  "spentUsd": "1.000000",
  "members": [
    {
      "userId": "id_example",
      "name": "example",
      "email": "dev@example.com",
      "spentMicros": "1000000",
      "spentUsd": "1.000000",
      "servers": 1
    }
  ]
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### PUT /budget

Αλλαγή του προϋπολογισμού

Amounts are in cents; a key present is changed, `null` clears the amount.

**Απαιτούμενο scope:** `full` · **Δικαίωμα:** `billing.manage`

**Σώμα αιτήματος**

| Όνομα | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- |
| `monthlyBudgetCents` | integer ή null | όχι |  |
| `alertThresholds` | πίνακας από `50` ή `80` ή `100` | όχι |  |
| `hardStop` | boolean | όχι |  |
| `lowBalanceCents` | integer ή null | όχι |  |
| `confirmHardStop` | boolean | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl -X PUT "https://apidly.com/api/v1/budget" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"monthlyBudgetCents":1,"alertThresholds":[50],"hardStop":false}'
```

**JavaScript (SDK)**

```js
await apidly.budget.set({
  monthlyBudgetCents: 1,
  alertThresholds: [
    50
  ],
  hardStop: false
});
```

**Python (SDK)**

```python
client.budget.set(body={
    "monthlyBudgetCents": 1,
    "alertThresholds": [50],
    "hardStop": False,
})
```

**Εργαλείο γραμμής εντολών:** `apidly budget` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "monthlyBudgetMicros": "1000000",
  "monthlyBudgetUsd": "1.000000",
  "alertThresholds": [
    1
  ],
  "hardStop": false,
  "lowBalanceThresholdMicros": "1000000",
  "lowBalanceThresholdUsd": "1.000000",
  "level": "none",
  "month": "example",
  "percent": 1,
  "spentMicros": "1000000",
  "spentUsd": "1.000000",
  "members": [
    {
      "userId": "id_example",
      "name": "example",
      "email": "dev@example.com",
      "spentMicros": "1000000",
      "spentUsd": "1.000000",
      "servers": 1
    }
  ]
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `429`.

### POST /billing/promo

Εξαργύρωση κωδικού προσφοράς

Adds the code's promotional credit to the balance, like **Redeem a code** in the console. Promotional credit is never refundable. An unknown, expired or used-up code answers 400 `invalid_code` (it never says which); 409 `already_redeemed` when this organization, its owner or the caller used it before; 400 `not_new_account` for a code that is only for new accounts. At most 5 attempts a minute and 20 an hour per organization.

**Απαιτούμενο scope:** `full` · **Δικαίωμα:** `billing.manage`

**Σώμα αιτήματος**

| Όνομα | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- |
| `code` | string | ναι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/billing/promo" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"WELCOME10"}'
```

**JavaScript (SDK)**

```js
await apidly.billing.redeemPromo("WELCOME10");
```

**Python (SDK)**

```python
client.billing.redeem_promo(code="WELCOME10")
```

**Εργαλείο γραμμής εντολών:** `apidly promo` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "promo": {
    "amountMicros": "1000000",
    "amountUsd": "1.000000",
    "balanceMicros": "1000000",
    "balanceUsd": "1.000000"
  }
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `409`, `429`.

### GET /billing/summary

Σύνοψη χρέωσης: υπόλοιπο, αυτόματη φόρτιση, προεπιλεγμένη κάρτα, συνδρομή και όρια φόρτισης

Read-only: the figures the console's billing page shows. The default card is its brand and last 4 digits only (null when none is saved or it cannot be read). Changing the auto top-up, the card or the subscription is done in the console.

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/billing/summary" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.summary();
```

**Python (SDK)**

```python
client.billing.summary()
```

**Εργαλείο γραμμής εντολών:** `apidly billing` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "summary": {
    "balanceMicros": "1000000",
    "balanceUsd": "1.000000",
    "burnPerHourMicros": "1000000",
    "burnPerHourUsd": "1.000000",
    "runwayHours": 1,
    "state": "ok",
    "graceUntil": "2026-11-21T10:00:00.000Z",
    "monthToDateMicros": "1000000",
    "monthToDateUsd": "1.000000",
    "autoTopup": {
      "enabled": false,
      "thresholdMicros": "1000000",
      "thresholdUsd": "1.000000",
      "amountCents": 1,
      "hasPaymentMethod": false
    },
    "defaultCard": {
      "brand": "example",
      "last4": "example"
    },
    "subscription": {
      "planId": "id_example",
      "status": "example",
      "monthlyCreditMicros": "1000000",
      "monthlyCreditUsd": "1.000000",
      "currentPeriodEnd": "2026-11-21T10:00:00.000Z",
      "cancelAtPeriodEnd": false
    },
    "limits": {
      "minTopupCents": 1,
      "maxTopupCents": 1,
      "newAccountCap": {
        "capCents": 1,
        "remainingCents": 1,
        "endsAt": "2026-11-21T10:00:00.000Z",
        "blocked": false,
        "liftsAt": "2026-11-21T10:00:00.000Z"
      }
    }
  }
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### PATCH /billing/auto-topup

Απενεργοποίηση αυτόματης επαναφόρτισης

Body `{ "enabled": false }`. Turns the organization's auto top-up off; the saved amount and threshold are kept, so the console can turn it back on with the same values. Turning it off again answers the same. Turning it on (`enabled: true`) is refused with 403 `forbidden`: that needs the authorisation the console shows to a person, so an API key can never start automatic charges. Behind a switch: 404 `feature_unavailable` while it is off.

**Απαιτούμενο scope:** `full` · **Δικαίωμα:** `billing.manage`

**Σώμα αιτήματος**

| Όνομα | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- |
| `enabled` | boolean | ναι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl -X PATCH "https://apidly.com/api/v1/billing/auto-topup" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":false}'
```

**JavaScript (SDK)**

```js
await apidly.billing.disableAutoTopup();
```

**Python (SDK)**

```python
client.billing.disable_auto_topup()
```

**Εργαλείο γραμμής εντολών:** `apidly billing` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "autoTopup": {
    "enabled": false,
    "thresholdMicros": "1000000",
    "thresholdUsd": "1.000000",
    "amountCents": 1
  }
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `404`, `429`.

### GET /billing/details

Όνομα χρέωσης, διεύθυνση και φορολογικό αναγνωριστικό

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/billing/details" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.getDetails();
```

**Python (SDK)**

```python
client.billing.get_details()
```

**Εργαλείο γραμμής εντολών:** `apidly billing-details` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "details": {
    "billingName": "example",
    "line1": "example",
    "line2": "example",
    "city": "example",
    "state": "example",
    "postalCode": "example",
    "country": "example",
    "taxId": "id_example",
    "taxIdType": "example"
  }
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### PUT /billing/details

Αποθήκευση των στοιχείων χρέωσης

**Απαιτούμενο scope:** `full` · **Δικαίωμα:** `billing.manage`

**Σώμα αιτήματος**

| Όνομα | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- |
| `billingName` | string | ναι |  |
| `line1` | string | ναι |  |
| `line2` | string | ναι |  |
| `city` | string | ναι |  |
| `state` | string | ναι |  |
| `postalCode` | string | ναι |  |
| `country` | string | ναι |  |
| `taxId` | string | ναι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl -X PUT "https://apidly.com/api/v1/billing/details" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"billingName":"example","line1":"example","line2":"example","city":"example","state":"example","postalCode":"example","country":"example","taxId":"id_example"}'
```

**JavaScript (SDK)**

```js
await apidly.billing.setDetails({
  billingName: "example",
  line1: "example",
  line2: "example",
  city: "example",
  state: "example",
  postalCode: "example",
  country: "example",
  taxId: "id_example"
});
```

**Python (SDK)**

```python
client.billing.set_details(details="example")
```

**Εργαλείο γραμμής εντολών:** `apidly billing-details` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "details": {
    "billingName": "example",
    "line1": "example",
    "line2": "example",
    "city": "example",
    "state": "example",
    "postalCode": "example",
    "country": "example",
    "taxId": "id_example",
    "taxIdType": "example"
  },
  "stripeSynced": false
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `429`.

### GET /statements

Μηνιαίες καταστάσεις, οι νεότερες πρώτα

One entry per UTC month from the one the organization was created in (at most 120). Totals: `GET /statements/{month}`.

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | όχι |  |
| `cursor` | query | string | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/statements?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.listStatements({ limit: 20 });
```

**Python (SDK)**

```python
client.billing.list_statements()
```

**Εργαλείο γραμμής εντολών:** `apidly statements` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "statements": [
    {
      "month": "example",
      "from": "2026-11-21T10:00:00.000Z",
      "to": "2026-11-21T10:00:00.000Z",
      "current": false
    }
  ],
  "nextCursor": "example"
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### GET /statements/{month}

Η κατάσταση ενός μήνα με σύνολα, διακομιστές και τόμους

`month` is `YYYY-MM` (UTC). 404 for a month before the organization existed or in the future. `?format=csv` downloads the per-server and per-volume rows as CSV (`text/csv`) instead of JSON. `?format=pdf` downloads the printable statement (`application/pdf`): seller and customer details, opening and closing balance, top-ups, adjustments and refunds, and usage per server and volume, with the same figures as the JSON. `lang` picks the label language for the PDF (English when the embedded font cannot draw that script).

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `month` | path | string | ναι |  |
| `format` | query | `json` \| `csv` \| `pdf` | όχι |  |
| `lang` | query | string | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/statements/2026-11" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.statement("2026-11");
await apidly.billing.statementCsv("2026-11");
await apidly.billing.statementPdf("2026-11");
```

**Python (SDK)**

```python
client.billing.statement("2026-11")
client.billing.statement_csv("2026-11")
client.billing.statement_pdf("2026-11")
```

**Εργαλείο γραμμής εντολών:** `apidly statements` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "statement": {
    "month": "example",
    "from": "2026-11-21T10:00:00.000Z",
    "to": "2026-11-21T10:00:00.000Z",
    "current": false,
    "computeMicros": "1000000",
    "computeUsd": "1.000000",
    "storageMicros": "1000000",
    "storageUsd": "1.000000",
    "volumeMicros": "1000000",
    "volumeUsd": "1.000000",
    "totalMicros": "1000000",
    "totalUsd": "1.000000",
    "openingBalanceMicros": "1000000",
    "openingBalanceUsd": "1.000000",
    "closingBalanceMicros": "1000000",
    "closingBalanceUsd": "1.000000",
    "credits": [
      {
        "type": "example",
        "amountMicros": "1000000",
        "amountUsd": "1.000000"
      }
    ],
    "servers": [
      {
        "key": "example",
        "label": "example",
        "tags": [],
        "destroyed": false,
        "computeMicros": "1000000",
        "computeUsd": "1.000000",
        "computeSeconds": 1,
        "storageMicros": "1000000",
        "storageUsd": "1.000000",
        "storageSeconds": 1,
        "volumeMicros": "1000000",
        "volumeUsd": "1.000000",
        "volumeSeconds": 1,
        "isVolume": false,
        "totalMicros": "1000000",
        "totalUsd": "1.000000"
      }
    ],
    "volumes": [
      {
        "volumeId": "id_example",
        "name": "example",
        "sizeGb": 1,
        "hours": 1,
        "amountMicros": "1000000",
        "amountUsd": "1.000000"
      }
    ],
    "days": [
      {
        "key": "example",
        "label": "example",
        "tags": [],
        "destroyed": false,
        "computeMicros": "1000000",
        "computeUsd": "1.000000",
        "computeSeconds": 1,
        "storageMicros": "1000000",
        "storageUsd": "1.000000",
        "storageSeconds": 1,
        "volumeMicros": "1000000",
        "volumeUsd": "1.000000",
        "volumeSeconds": 1,
        "isVolume": false,
        "totalMicros": "1000000",
        "totalUsd": "1.000000"
      }
    ]
  }
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `404`, `429`.

### GET /ledger/{id}/receipt

Απόδειξη πληρωμής (PDF) μιας αναπλήρωσης

`id` is the `id` of a ledger entry of type `topup`. Returns `application/pdf`: date, amount, currency, payment reference and balance after. 404 when the entry is not a top-up of this organization. `lang` picks the label language (English when the embedded font cannot draw that script).

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `id` | path | string | ναι |  |
| `lang` | query | string | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/ledger/ledger_example/receipt" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.receiptPdf("ledger_example");
```

**Python (SDK)**

```python
client.billing.receipt_pdf(entry_id="example")
```

**Εργαλείο γραμμής εντολών:** `apidly ledger` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

`application/pdf`

Καταστάσεις σφάλματος: `401`, `403`, `404`, `429`.

### GET /budget/status

Δαπάνες αυτού του μήνα σε σχέση με τον προϋπολογισμό

`level` is `none` without a budget, else `ok`, `warn`, `critical` or `reached` (the console banner's levels); `percent` is spend as a share of the budget.

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/budget/status" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.budget.status();
```

**Python (SDK)**

```python
client.budget.status()
```

**Εργαλείο γραμμής εντολών:** `apidly budget` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "status": {
    "month": "example",
    "level": "none",
    "percent": 1,
    "hardStop": false,
    "spentMicros": "1000000",
    "spentUsd": "1.000000",
    "budgetMicros": "1000000",
    "budgetUsd": "1.000000"
  }
}
```

Καταστάσεις σφάλματος: `401`, `403`, `429`.

### GET /invoices/{id}

Ένα τιμολόγιο ως σελίδα για εκτύπωση

Returns `text/html`: the invoice page the console opens (bill-to details, lines, total). `lang` picks the label language (English otherwise). 404 for an invoice of another organization.

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `id` | path | string | ναι |  |
| `lang` | query | string | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/invoices/invoice_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.invoiceHtml("invoice_example");
```

**Python (SDK)**

```python
client.billing.invoice_html(invoice_id="example")
```

**Εργαλείο γραμμής εντολών:** `apidly invoice` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

`text/html`

Καταστάσεις σφάλματος: `401`, `403`, `404`, `429`.

### GET /servers/{id}/billing

Πόσο κόστισε ένας διακομιστής

Compute, storage and total since the server was created and for the current UTC month. Data transfer is not metered.

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `id` | path | string | ναι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/servers/ins_example/billing" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.servers.billing("ins_example");
```

**Python (SDK)**

```python
client.servers.billing("ins_example")
```

**Εργαλείο γραμμής εντολών:** `apidly status`, `apidly cost` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

```json
{
  "billing": {
    "computeMicros": "1000000",
    "computeUsd": "1.000000",
    "storageMicros": "1000000",
    "storageUsd": "1.000000",
    "totalMicros": "1000000",
    "totalUsd": "1.000000",
    "monthComputeMicros": "1000000",
    "monthComputeUsd": "1.000000",
    "monthStorageMicros": "1000000",
    "monthStorageUsd": "1.000000",
    "monthTotalMicros": "1000000",
    "monthTotalUsd": "1.000000"
  }
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `404`, `429`.

### GET /billing/export

Χρήση ή καθολικό ως αρχείο CSV

Returns `text/csv` for the whole range (not one page). `kind=usage` groups by `groupBy` (`instance`, `day`, `gpu`, `member`, `template`, `tag`, or `detail` for one row per day, server and kind; under `tag` a server with several tags is counted under each); its range defaults to this month and is at most two years. `kind=ledger` covers `from`/`to` (at most two years) and, without `from`, the last 12 months up to `to` (default now); for older entries pass `from`. Optionally one `type`. Cells are formula-safe.

**Απαιτούμενο scope:** `read` · **Δικαίωμα:** `billing.view`

**Παράμετροι**

| Όνομα | Σε | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- | --- |
| `kind` | query | `usage` \| `ledger` | όχι |  |
| `groupBy` | query | `instance` \| `day` \| `gpu` \| `member` \| `template` \| `tag` \| `apiKey` \| `detail` | όχι |  |
| `from` | query | string ή string | όχι |  |
| `to` | query | string ή string | όχι |  |
| `type` | query | `topup` \| `usage` \| `refund` \| `adjustment` \| `subscription_credit` \| `promo` | όχι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl "https://apidly.com/api/v1/billing/export" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.billing.export();
```

**Python (SDK)**

```python
client.billing.export()
```

**Εργαλείο γραμμής εντολών:** `apidly export` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (200)

`text/csv`

Καταστάσεις σφάλματος: `400`, `401`, `403`, `429`.

### POST /billing/refund-requests

Αίτημα επιστροφής χρημάτων

Opens a billing support ticket with the amount (US cents) and your reason. No money moves: a person reviews it under the Refund Policy and answers on the ticket. Three requests a day per organization.

**Απαιτούμενο scope:** `full` · **Δικαίωμα:** `billing.manage` · **Ασφαλής επανάληψη με:** `Idempotency-Key`

**Σώμα αιτήματος**

| Όνομα | Τύπος | Υποχρεωτικό | Περιγραφή |
| --- | --- | --- | --- |
| `amountCents` | integer | ναι |  |
| `reason` | string | ναι |  |

**Παράδειγμα αιτήματος (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/billing/refund-requests" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amountCents":1,"reason":"example"}'
```

**JavaScript (SDK)**

```js
await apidly.billing.requestRefund({
  amountCents: 1,
  reason: "example"
});
```

**Python (SDK)**

```python
client.billing.request_refund(amount_cents=1, reason="example")
```

**Εργαλείο γραμμής εντολών:** `apidly refund` ([Αναφορά CLI](/docs/cli))

**Παράδειγμα απάντησης** (201)

```json
{
  "ticketId": "id_example"
}
```

Καταστάσεις σφάλματος: `400`, `401`, `403`, `429`.
