Zum Hauptinhalt springen
DokumentationNutzung · console.eu.ccsio.ai

Reservations

Budget reservations: reserve, commit and release.

Menü der Dokumentation

Die Beschreibungen der Operationen und Felder stammen aus dem Vertrag und sind auf Englisch.

POST/metering/v1/reservations

Reserve budget

Anmeldedaten
API-Key
Berechtigung
usage.manage
Request-Body
Body bis 1 MiB

Reserves budget for a scope. The binding (allocations, unit, ceiling) is resolved by the budget policy, not sent. A scope with no binding is 400 budget-denied (default-deny, nothing booked). A budget policy lookup failure is 500 budget-policy-unknown, fails closed (nothing is booked). A duplicate reservation_id for a different request is 400 reservation-conflict. ttl_seconds minimum is 1. The request body is capped at 1048576 bytes; over-cap is 400 invalid-request, never 413.

curl
curl -X POST "https://console.eu.ccsio.ai/metering/v1/reservations" \
  -H "Authorization: Bearer $CCSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "reservation_id": "string",
  "tenant_id": "string",
  "plane_id": "string",
  "root_run_id": "string",
  "amount": "string",
  "ttl_seconds": 0
}'
Aus den Pflichtfeldern des Schemas erzeugt: ersetze die Werte.

Parameter

NameInBeschreibung
X-Request-ID
optional
headerstring

Optional request ULID. A valid ULID (upper or lowercase) is honored; when the header is absent or invalid, the runtime mints the id. The response X-Request-ID header carries the canonical uppercase form.

Request-Body application/json

ReserveRequest
  • reservation_idstringPflicht

    pattern ^[a-z][a-z0-9._-]{0,127}$

  • tenant_idstringPflicht

    pattern ^[a-z][a-z0-9._-]{0,127}$

  • plane_idstringPflicht

    pattern ^[a-z][a-z0-9._-]{0,127}$

  • root_run_idstringPflicht

    pattern ^[a-z][a-z0-9._-]{0,127}$

  • amountstringPflicht

    The money canonical string: <integer minor units> <3-letter ISO 4217 currency> (e.g. 10 USD). A malformed string is 400 invalid-request (decode); a parsed-but-non-positive amount is 400 reservation-invalid (use case). The integer minor-units field is int64-bounded: a value outside the int64 range is 400 invalid-request at decode (the pattern is syntactic; the decode layer enforces the range).

    pattern ^-?[0-9]+ [A-Z]{3}$

  • ttl_secondsintegerPflicht

    at least 1

Antworten

  • 200

    The reservation, in the reserved state.

    Schema
    ReservationView
    • reservation_idstringPflicht

      pattern ^[a-z][a-z0-9._-]{0,127}$

    • statestringPflicht

      The reservation state machine state.

      Erlaubte Werte: "reserved""committed""released""expired"

    • amountstringPflicht

      The money canonical string: <integer minor units> <3-letter ISO 4217 currency> (e.g. 10 USD). A malformed string is 400 invalid-request (decode); a parsed-but-non-positive amount is 400 reservation-invalid (use case). The integer minor-units field is int64-bounded: a value outside the int64 range is 400 invalid-request at decode (the pattern is syntactic; the decode layer enforces the range).

      pattern ^-?[0-9]+ [A-Z]{3}$

    • reserved_atstringPflicht

      pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$

    • expires_atstringPflicht

      pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$

    • bindingobjectPflicht

      The budget binding: the scope identifiers, allocations (1..3 unique slugs), unit, and ceiling (C8).

      • tenant_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • plane_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • root_run_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • allocation_idsarray of stringPflicht

        at least 1 items · at most 3 items

      • unitstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • ceilingintegerPflicht

        1 to 9007199254740991

  • 400

    Client refusal. Codes: invalid-request, slug-invalid, reservation-invalid, budget-denied, reservation-conflict

  • 401

    The request carries no credential, more than one, or one the platform does not accept, and is refused before the operation runs; `error.code` says why. Supply exactly one credential. Codes: invalid-request (no credential, or both Authorization:

    Weiterlesen

    Bearer and x-api-key), api-key-invalid (a value that is not a platform API key, or a key of a kind the platform does not accept), api-key-unknown, api-key-revoked, api-key-expired, bootstrap-disabled (the one-shot installation credential, once a key exists), token-malformed (a bearer token that is not a JWT), token-algorithm-unsupported, token-signature-invalid, token-claim-invalid, token-issuer-mismatch, token-audience-mismatch, token-expired, token-not-yet-valid, issuer-untrusted, issuer-residency-mismatch (the issuer belongs to another plane), issuer-resolution-unknown, jwks-unavailable, jwks-key-not-found, staff-token-inactive (a platform operator's token), staff-not-operator, staff-directory-unavailable, identity-not-provisioned (a verified identity with no account on this plane), organization-not-found (a verified identity or key whose organization this plane does not know), internal-error (a fault while the credential is checked is refused too, fail closed), context-cancelled

  • 402

    The organization has to pay first: its standing is payment_required.

    Weiterlesen

    The request boundary applies this payment gate to every route except an organization's billing routes, the caller's own context, organization list, onboarding, session report and personal keys, the public routes, and the routes of platform operators, who administer an organization that has to pay. The operations the gate covers declare this response. On /v1 the refusal is rendered in the OpenAI error format. Code: payment-required

  • 403

    No role of the caller holds `usage.manage` in the organization (policy-denied), or the organization the request names is not the caller's own (tenant-mismatch). Codes: policy-denied, tenant-mismatch

  • 405

    The path is claimed but the request method is not allowed. Go ServeMux returns its standard plain-text response and lists permitted methods in Allow.

  • 500

    Platform failure. Codes: budget-policy-unknown, internal-error

POST/metering/v1/reservations/{id}/commit

Commit a reservation in full

Anmeldedaten
API-Key
Berechtigung
usage.manage
Request-Body
Body bis 1 MiB

Commits a reservation in full. The amount must equal the reserved amount (the domain enforces it). Pinned precedence: an unknown reservation id is 404 reservation-not-found even with a missing amount (lookup before shape); a non-empty unparseable body is 400 invalid-request before the lookup; a known reservation with a missing amount is 400 invalid-request. The request body is capped at 1048576 bytes; over-cap is 400 invalid-request, never 413.

curl
curl -X POST "https://console.eu.ccsio.ai/metering/v1/reservations/{id}/commit" \
  -H "Authorization: Bearer $CCSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Aus den Pflichtfeldern des Schemas erzeugt: ersetze die Werte.

Parameter

NameInBeschreibung
X-Request-ID
optional
headerstring

Optional request ULID. A valid ULID (upper or lowercase) is honored; when the header is absent or invalid, the runtime mints the id. The response X-Request-ID header carries the canonical uppercase form.

id
Pflicht
pathstring

The reservation identifier (C2/C8 slug pattern).

Request-Body application/json

CommitRequest
  • amountstringoptional

    The money canonical string: <integer minor units> <3-letter ISO 4217 currency> (e.g. 10 USD). A malformed string is 400 invalid-request (decode); a parsed-but-non-positive amount is 400 reservation-invalid (use case). The integer minor-units field is int64-bounded: a value outside the int64 range is 400 invalid-request at decode (the pattern is syntactic; the decode layer enforces the range).

    pattern ^-?[0-9]+ [A-Z]{3}$

Antworten

  • 200

    The reservation, in the committed state.

    Schema
    ReservationView
    • reservation_idstringPflicht

      pattern ^[a-z][a-z0-9._-]{0,127}$

    • statestringPflicht

      The reservation state machine state.

      Erlaubte Werte: "reserved""committed""released""expired"

    • amountstringPflicht

      The money canonical string: <integer minor units> <3-letter ISO 4217 currency> (e.g. 10 USD). A malformed string is 400 invalid-request (decode); a parsed-but-non-positive amount is 400 reservation-invalid (use case). The integer minor-units field is int64-bounded: a value outside the int64 range is 400 invalid-request at decode (the pattern is syntactic; the decode layer enforces the range).

      pattern ^-?[0-9]+ [A-Z]{3}$

    • reserved_atstringPflicht

      pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$

    • expires_atstringPflicht

      pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$

    • bindingobjectPflicht

      The budget binding: the scope identifiers, allocations (1..3 unique slugs), unit, and ceiling (C8).

      • tenant_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • plane_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • root_run_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • allocation_idsarray of stringPflicht

        at least 1 items · at most 3 items

      • unitstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • ceilingintegerPflicht

        1 to 9007199254740991

  • 400

    Client refusal. Codes: invalid-request, slug-invalid, reservation-over-commit, reservation-partial-commit, reservation-commit-mismatch, reservation-illegal-transition

  • 401

    The request carries no credential, more than one, or one the platform does not accept, and is refused before the operation runs; `error.code` says why. Supply exactly one credential. Codes: invalid-request (no credential, or both Authorization:

    Weiterlesen

    Bearer and x-api-key), api-key-invalid (a value that is not a platform API key, or a key of a kind the platform does not accept), api-key-unknown, api-key-revoked, api-key-expired, bootstrap-disabled (the one-shot installation credential, once a key exists), token-malformed (a bearer token that is not a JWT), token-algorithm-unsupported, token-signature-invalid, token-claim-invalid, token-issuer-mismatch, token-audience-mismatch, token-expired, token-not-yet-valid, issuer-untrusted, issuer-residency-mismatch (the issuer belongs to another plane), issuer-resolution-unknown, jwks-unavailable, jwks-key-not-found, staff-token-inactive (a platform operator's token), staff-not-operator, staff-directory-unavailable, identity-not-provisioned (a verified identity with no account on this plane), organization-not-found (a verified identity or key whose organization this plane does not know), internal-error (a fault while the credential is checked is refused too, fail closed), context-cancelled

  • 402

    The organization has to pay first: its standing is payment_required.

    Weiterlesen

    The request boundary applies this payment gate to every route except an organization's billing routes, the caller's own context, organization list, onboarding, session report and personal keys, the public routes, and the routes of platform operators, who administer an organization that has to pay. The operations the gate covers declare this response. On /v1 the refusal is rendered in the OpenAI error format. Code: payment-required

  • 403

    No role of the caller holds `usage.manage` in the organization (policy-denied). Codes: policy-denied

  • 404

    The reservation is unknown. Codes: reservation-not-found

  • 405

    The path is claimed but the request method is not allowed. Go ServeMux returns its standard plain-text response and lists permitted methods in Allow.

  • 500

    Platform failure. Codes: internal-error

POST/metering/v1/reservations/{id}/release

Release a reservation

Anmeldedaten
API-Key
Berechtigung
usage.manage

Releases a reservation. An unknown reservation id is 404 reservation-not-found. A release from a non-reserved state is 400 reservation-illegal-transition.

curl
curl -X POST "https://console.eu.ccsio.ai/metering/v1/reservations/{id}/release" \
  -H "Authorization: Bearer $CCSIO_API_KEY"

Parameter

NameInBeschreibung
X-Request-ID
optional
headerstring

Optional request ULID. A valid ULID (upper or lowercase) is honored; when the header is absent or invalid, the runtime mints the id. The response X-Request-ID header carries the canonical uppercase form.

id
Pflicht
pathstring

The reservation identifier (C2/C8 slug pattern).

Antworten

  • 200

    The reservation, in the released state.

    Schema
    ReservationView
    • reservation_idstringPflicht

      pattern ^[a-z][a-z0-9._-]{0,127}$

    • statestringPflicht

      The reservation state machine state.

      Erlaubte Werte: "reserved""committed""released""expired"

    • amountstringPflicht

      The money canonical string: <integer minor units> <3-letter ISO 4217 currency> (e.g. 10 USD). A malformed string is 400 invalid-request (decode); a parsed-but-non-positive amount is 400 reservation-invalid (use case). The integer minor-units field is int64-bounded: a value outside the int64 range is 400 invalid-request at decode (the pattern is syntactic; the decode layer enforces the range).

      pattern ^-?[0-9]+ [A-Z]{3}$

    • reserved_atstringPflicht

      pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$

    • expires_atstringPflicht

      pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$

    • bindingobjectPflicht

      The budget binding: the scope identifiers, allocations (1..3 unique slugs), unit, and ceiling (C8).

      • tenant_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • plane_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • root_run_idstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • allocation_idsarray of stringPflicht

        at least 1 items · at most 3 items

      • unitstringPflicht

        pattern ^[a-z][a-z0-9._-]{0,127}$

      • ceilingintegerPflicht

        1 to 9007199254740991

  • 400

    Client refusal. Codes: slug-invalid, reservation-illegal-transition

  • 401

    The request carries no credential, more than one, or one the platform does not accept, and is refused before the operation runs; `error.code` says why. Supply exactly one credential. Codes: invalid-request (no credential, or both Authorization:

    Weiterlesen

    Bearer and x-api-key), api-key-invalid (a value that is not a platform API key, or a key of a kind the platform does not accept), api-key-unknown, api-key-revoked, api-key-expired, bootstrap-disabled (the one-shot installation credential, once a key exists), token-malformed (a bearer token that is not a JWT), token-algorithm-unsupported, token-signature-invalid, token-claim-invalid, token-issuer-mismatch, token-audience-mismatch, token-expired, token-not-yet-valid, issuer-untrusted, issuer-residency-mismatch (the issuer belongs to another plane), issuer-resolution-unknown, jwks-unavailable, jwks-key-not-found, staff-token-inactive (a platform operator's token), staff-not-operator, staff-directory-unavailable, identity-not-provisioned (a verified identity with no account on this plane), organization-not-found (a verified identity or key whose organization this plane does not know), internal-error (a fault while the credential is checked is refused too, fail closed), context-cancelled

  • 402

    The organization has to pay first: its standing is payment_required.

    Weiterlesen

    The request boundary applies this payment gate to every route except an organization's billing routes, the caller's own context, organization list, onboarding, session report and personal keys, the public routes, and the routes of platform operators, who administer an organization that has to pay. The operations the gate covers declare this response. On /v1 the refusal is rendered in the OpenAI error format. Code: payment-required

  • 403

    No role of the caller holds `usage.manage` in the organization (policy-denied). Codes: policy-denied

  • 404

    The reservation is unknown. Codes: reservation-not-found

  • 405

    The path is claimed but the request method is not allowed. Go ServeMux returns its standard plain-text response and lists permitted methods in Allow.

  • 500

    Platform failure. Codes: internal-error

Erzeugt aus den Plattformverträgen beim Commit 5954fbc1.

Plattform entdecken

Deinen ersten API-Key holen

Die Registrierung ist offen. Vier Schritte bis zum ersten Aufruf: Konto erstellen, Organisation anlegen, API-Key erzeugen, loslegen.

  1. 01Konto erstellen
  2. 02Organisation anlegen
  3. 03API-Key erzeugen
  4. 04Loslegen