---
updatedAt: 2025-08-05T00:31:04.000Z
agentTools:
  projectIndex: https://docs.ascerta.com/llms.txt
---

# Ingest an Event

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Pay-i",
    "description": "Pay-i API",
    "version": "v1"
  },
  "paths": {
    "/api/v1/ingest": {
      "post": {
        "tags": [
          "Ingest Events"
        ],
        "summary": "Ingest an Event",
        "operationId": "requests.Ingest",
        "parameters": [
          {
            "name": "xProxy-Resource-Scope",
            "in": "header",
            "description": "Resource scope",
            "schema": {
              "type": "string"
            },
            "example": "datazone"
          },
          {
            "name": "xProxy-Limit-IDs",
            "in": "header",
            "description": "Comma separated list of limit ID strings",
            "schema": {
              "type": "string"
            },
            "example": "limitId1, limitId_2"
          },
          {
            "name": "xProxy-User-ID",
            "in": "header",
            "description": "User ID",
            "schema": {
              "type": "string"
            },
            "example": "UserName123"
          },
          {
            "name": "xProxy-UseCase-ID",
            "in": "header",
            "description": "Use Case ID",
            "schema": {
              "type": "string"
            },
            "example": "use_case_id"
          },
          {
            "name": "xProxy-UseCase-Name",
            "in": "header",
            "description": "Use Case Name",
            "schema": {
              "type": "string"
            },
            "example": "use_case_name"
          },
          {
            "name": "xProxy-UseCase-Version",
            "in": "header",
            "description": "Use Case Version",
            "schema": {
              "type": "integer"
            },
            "example": "1"
          },
          {
            "name": "xProxy-UseCase-Step",
            "in": "header",
            "description": "Use Case Step",
            "schema": {
              "type": "string"
            },
            "example": "step_1"
          },
          {
            "name": "xProxy-Account-Name",
            "in": "header",
            "description": "Account Name",
            "schema": {
              "type": "string"
            },
            "example": "account_name"
          },
          {
            "name": "xProxy-Logging-Disable",
            "in": "header",
            "description": "Disable Logging",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayI.Common.Models.ApiRouter.IngestRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PayI.Common.Models.ApiRouter.IngestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayI.Common.Models.IngestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayI.Common.Models.ProxyApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayI.Common.Models.ApiError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PayI.Common.Data.BudgetManagement.Enums.LimitStatus": {
        "enum": [
          "ok",
          "blocked",
          "blocked_external",
          "exceeded",
          "overrun",
          "failed"
        ],
        "type": "string"
      },
      "PayI.Common.Enums.Currency": {
        "enum": [
          "usd"
        ],
        "type": "string"
      },
      "PayI.Common.Models.ApiError": {
        "required": [
          "message",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "message": {
            "minLength": 1,
            "type": "string"
          },
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "xproxy_error": {
            "$ref": "#/components/schemas/PayI.Common.Models.ProxyError"
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.ApiRouter.FunctionCallInfo": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "arguments": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.ApiRouter.HeaderInfo": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.ApiRouter.IngestRequest": {
        "required": [
          "category",
          "units"
        ],
        "type": "object",
        "properties": {
          "category": {
            "minLength": 1,
            "type": "string"
          },
          "resource": {
            "type": "string",
            "nullable": true
          },
          "event_timestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PayI.Common.Models.ApiRouter.IngestUnits"
            }
          },
          "end_to_end_latency_ms": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "time_to_first_token_ms": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "time_to_first_completion_token_ms": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "http_status_code": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "provider_uri": {
            "type": "string",
            "nullable": true
          },
          "provider_request_reasoning_json": {
            "type": "string",
            "nullable": true
          },
          "provider_request_json": {
            "type": "string",
            "nullable": true
          },
          "provider_request_headers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayI.Common.Models.ApiRouter.HeaderInfo"
            },
            "nullable": true
          },
          "provider_response_json": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "nullable": true
          },
          "provider_response_headers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayI.Common.Models.ApiRouter.HeaderInfo"
            },
            "nullable": true
          },
          "provider_response_function_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayI.Common.Models.ApiRouter.FunctionCallInfo"
            },
            "nullable": true
          },
          "provider_response_id": {
            "type": "string",
            "nullable": true
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "nullable": true
          },
          "use_case_properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.ApiRouter.IngestUnits": {
        "type": "object",
        "properties": {
          "input": {
            "maximum": 2147483647,
            "minimum": 0,
            "type": "integer",
            "format": "int32"
          },
          "output": {
            "maximum": 2147483647,
            "minimum": 0,
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.BudgetManagement.CostDetails": {
        "required": [
          "base"
        ],
        "type": "object",
        "properties": {
          "base": {
            "type": "number",
            "format": "double"
          },
          "overrun_base": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.BudgetManagement.CostDetailsBase": {
        "required": [
          "base"
        ],
        "type": "object",
        "properties": {
          "base": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.IngestResponse": {
        "required": [
          "event_timestamp",
          "ingest_timestamp",
          "request_id",
          "xproxy_result"
        ],
        "type": "object",
        "properties": {
          "request_id": {
            "minLength": 1,
            "type": "string"
          },
          "ingest_timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "event_timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "xproxy_result": {
            "$ref": "#/components/schemas/PayI.Common.Models.Proxy.ProxyResult"
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.Proxy.ProxyLimitStatus": {
        "type": "object",
        "properties": {
          "state": {
            "$ref": "#/components/schemas/PayI.Common.Data.BudgetManagement.Enums.LimitStatus"
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.Proxy.ProxyResult": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "request_tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "example": [
              "requestTag1",
              "request_tag_2"
            ]
          },
          "limits": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PayI.Common.Models.Proxy.ProxyLimitStatus"
            },
            "nullable": true,
            "example": {
              "limitId1": {
                "State": "OK"
              },
              "limitId_2": {
                "State": "Exceeeded"
              }
            }
          },
          "use_case_name": {
            "type": "string",
            "nullable": true
          },
          "use_case_id": {
            "type": "string",
            "nullable": true
          },
          "use_case_step": {
            "type": "string",
            "nullable": true
          },
          "resource_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "account_name": {
            "type": "string",
            "nullable": true
          },
          "blocked_limit_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "example": [
              "limitId_2"
            ]
          },
          "cost": {
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/PayI.Common.Models.Proxy.RequestCost"
              }
            ],
            "nullable": true
          },
          "unknown_units": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PayI.Common.Models.ApiRouter.IngestUnits"
            },
            "nullable": true
          },
          "duplicate_request": {
            "type": "boolean",
            "nullable": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "queued": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.Proxy.RequestCost": {
        "type": "object",
        "properties": {
          "currency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PayI.Common.Enums.Currency"
              }
            ],
            "nullable": true
          },
          "input": {
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/PayI.Common.Models.BudgetManagement.CostDetailsBase"
              }
            ],
            "nullable": true
          },
          "output": {
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/PayI.Common.Models.BudgetManagement.CostDetailsBase"
              }
            ],
            "nullable": true
          },
          "total": {
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/PayI.Common.Models.BudgetManagement.CostDetails"
              }
            ],
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.ProxyApiError": {
        "required": [
          "message",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "message": {
            "minLength": 1,
            "type": "string"
          },
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "xproxy_error": {
            "$ref": "#/components/schemas/PayI.Common.Models.ProxyError"
          },
          "xproxy_result": {
            "$ref": "#/components/schemas/PayI.Common.Models.Proxy.ProxyResult"
          }
        },
        "additionalProperties": false
      },
      "PayI.Common.Models.ProxyError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Pay_I_API_Key": {
        "type": "apiKey",
        "description": "Pay-I API Key. Example: \"{apikey}\"",
        "name": "xProxy-api-key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Pay_I_API_Key": []
    }
  ],
  "tags": [
    {
      "name": "Ingest Events",
      "description": "Ingest Requests"
    }
  ],
  "servers": [
    {
      "url": "https://api.pay-i.com"
    }
  ]
}
```