Get Usage

GET /v1/usage/

Query parameters

  • workspace_uuid string | null

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • billing_cycles array[object] | null
      Hide billing_cycles attributes Show billing_cycles attributes object
      • billing_cycle_uuid string Required
      • billing_cycle_start_date string(date) Required
      • billing_cycle_end_date string(date) Required
      • paid_amount_usd number | string Required

      • score_runs array[object] Required
        Hide score_runs attributes Show score_runs attributes object
        • score_run_uuid string Required
        • score_run_status string Required

          Values are record_created, image_uploading, scoring, finished, or failed.

        • test object Required
          Hide test attributes Show test attributes object
          • test_uuid string Required
          • test_name string Required
          • test_status string Required

            Test status.

            Values are record_created, generating_questions, finished, or failed.

          • test_type string Required
          • organization_name string | null
          • num_test_questions integer | null
          • created_at string(date-time) Required
          • updated_at string(date-time) Required
          • test_system_prompt string | null
          • test_policy string | null
          • knowledge_base string | null
          • additional_instructions string | null
          • is_jailbreak boolean

            Default value is false.

          • modality string

            Content type for AI interactions.

            Values are text or image. Default value is text.

          • test_examples array[object] | null
            Hide test_examples attributes Show test_examples attributes object
            • example_uuid string Required
            • example_text string Required
            • explanation string | null
            • example_type string Required

              Values are good or bad.

        • created_at string(date-time) Required
        • updated_at string(date-time) Required
        • remaining_score_runs integer | null
        • price number Required
        • price_adjustment_note string | null
        • created_by object | null
          Hide created_by attributes Show created_by attributes object | null
          • email string Required
          • organization object | null
            Hide organization attributes Show organization attributes object | null
            • org_uuid string Required
            • name string Required
          • is_admin boolean Required
          • is_impersonating boolean Required
          • feature_flags object Required
            Hide feature_flags attribute Show feature_flags attribute object
            • enable_dashboard boolean Required
        • score_run_examples array[object] | null
          Hide score_run_examples attributes Show score_run_examples attributes object
          • example_uuid string Required
          • question_text string Required
          • answer_text string Required
          • explanation string Required
          • example_type string Required

            Values are pass or fail.

        • pass_rate number | null
    • free_score_runs array[object] | null
      Hide free_score_runs attributes Show free_score_runs attributes object
      • score_run_uuid string Required
      • score_run_status string Required

        Values are record_created, image_uploading, scoring, finished, or failed.

      • test object Required
        Hide test attributes Show test attributes object
        • test_uuid string Required
        • test_name string Required
        • test_status string Required

          Test status.

          Values are record_created, generating_questions, finished, or failed.

        • test_type string Required
        • organization_name string | null
        • num_test_questions integer | null
        • created_at string(date-time) Required
        • updated_at string(date-time) Required
        • test_system_prompt string | null
        • test_policy string | null
        • knowledge_base string | null
        • additional_instructions string | null
        • is_jailbreak boolean

          Default value is false.

        • modality string

          Content type for AI interactions.

          Values are text or image. Default value is text.

        • test_examples array[object] | null
          Hide test_examples attributes Show test_examples attributes object
          • example_uuid string Required
          • example_text string Required
          • explanation string | null
          • example_type string Required

            Values are good or bad.

      • created_at string(date-time) Required
      • updated_at string(date-time) Required
      • remaining_score_runs integer | null
      • price number Required
      • price_adjustment_note string | null
      • created_by object | null
        Hide created_by attributes Show created_by attributes object | null
        • email string Required
        • organization object | null
          Hide organization attributes Show organization attributes object | null
          • org_uuid string Required
          • name string Required
        • is_admin boolean Required
        • is_impersonating boolean Required
        • feature_flags object Required
          Hide feature_flags attribute Show feature_flags attribute object
          • enable_dashboard boolean Required
      • score_run_examples array[object] | null
        Hide score_run_examples attributes Show score_run_examples attributes object
        • example_uuid string Required
        • question_text string Required
        • answer_text string Required
        • explanation string Required
        • example_type string Required

          Values are pass or fail.

      • pass_rate number | null
    • test_type_displays object Required
      Hide test_type_displays attribute Show test_type_displays attribute object
      • * string Additional properties
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 403 application/json

    Forbidden

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 404 application/json

    Not Found

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 409 application/json

    Conflict

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 422 application/json

    Unprocessable Entity

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 429 application/json

    Too Many Requests

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

  • 503 application/json

    Service Unavailable

    Hide response attributes Show response attributes object
    • error object Required

      Schema for the contents of an error response.

      This schema defines the structure of the error data inside the error field of an API error response.

      Hide error attributes Show error attributes object
      • code string Required

        Enumeration of all error codes used in the API.

        Values are auth.invalid_key, auth.expired_key, auth.insufficient_permissions, validation.invalid_request, validation.invalid_format, resource.not_found, resource.conflict, quota.limit_exceeded, or server.internal_error.

      • message string Required
      • details object

        Default value is {} (empty).

    • request_id string

      Default value is empty.

GET /v1/usage/
curl \
 --request GET 'https://api.aymara.ai/v1/usage/' \
 --header "x-api-key: $API_KEY"
Response examples (200)
{
  "billing_cycles": [
    {
      "billing_cycle_uuid": "string",
      "billing_cycle_start_date": "2025-05-04",
      "billing_cycle_end_date": "2025-05-04",
      "paid_amount_usd": 42.0,
      "score_runs": [
        {
          "score_run_uuid": "string",
          "score_run_status": "record_created",
          "test": {
            "test_uuid": "string",
            "test_name": "string",
            "test_status": "record_created",
            "test_type": "string",
            "organization_name": "string",
            "num_test_questions": 42,
            "created_at": "2025-05-04T09:42:00Z",
            "updated_at": "2025-05-04T09:42:00Z",
            "test_system_prompt": "string",
            "test_policy": "string",
            "knowledge_base": "string",
            "additional_instructions": "string",
            "is_jailbreak": false,
            "modality": "text",
            "test_examples": [
              {
                "example_uuid": "string",
                "example_text": "string",
                "explanation": "string",
                "example_type": "good"
              }
            ]
          },
          "created_at": "2025-05-04T09:42:00Z",
          "updated_at": "2025-05-04T09:42:00Z",
          "remaining_score_runs": 42,
          "price": 42.0,
          "price_adjustment_note": "string",
          "created_by": {
            "email": "string",
            "organization": {
              "org_uuid": "string",
              "name": "string"
            },
            "is_admin": true,
            "is_impersonating": true,
            "feature_flags": {
              "enable_dashboard": true
            }
          },
          "score_run_examples": [
            {
              "example_uuid": "string",
              "question_text": "string",
              "answer_text": "string",
              "explanation": "string",
              "example_type": "pass"
            }
          ],
          "pass_rate": 42.0
        }
      ]
    }
  ],
  "free_score_runs": [
    {
      "score_run_uuid": "string",
      "score_run_status": "record_created",
      "test": {
        "test_uuid": "string",
        "test_name": "string",
        "test_status": "record_created",
        "test_type": "string",
        "organization_name": "string",
        "num_test_questions": 42,
        "created_at": "2025-05-04T09:42:00Z",
        "updated_at": "2025-05-04T09:42:00Z",
        "test_system_prompt": "string",
        "test_policy": "string",
        "knowledge_base": "string",
        "additional_instructions": "string",
        "is_jailbreak": false,
        "modality": "text",
        "test_examples": [
          {
            "example_uuid": "string",
            "example_text": "string",
            "explanation": "string",
            "example_type": "good"
          }
        ]
      },
      "created_at": "2025-05-04T09:42:00Z",
      "updated_at": "2025-05-04T09:42:00Z",
      "remaining_score_runs": 42,
      "price": 42.0,
      "price_adjustment_note": "string",
      "created_by": {
        "email": "string",
        "organization": {
          "org_uuid": "string",
          "name": "string"
        },
        "is_admin": true,
        "is_impersonating": true,
        "feature_flags": {
          "enable_dashboard": true
        }
      },
      "score_run_examples": [
        {
          "example_uuid": "string",
          "question_text": "string",
          "answer_text": "string",
          "explanation": "string",
          "example_type": "pass"
        }
      ],
      "pass_rate": 42.0
    }
  ],
  "test_type_displays": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  }
}
Response examples (400)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (401)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (403)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (404)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (409)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (422)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (429)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (500)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}
Response examples (503)
{
  "error": {
    "code": "auth.invalid_key",
    "message": "string",
    "details": {}
  },
  "request_id": ""
}