{
  "openapi": "3.1.0",
  "info": {
    "title": "Emetry Gateway",
    "description": "External API for LLM consumers \u2014 verification marketplace. Private beta: email hello@emetry.ai for an API key. Authenticate with the X-API-Key header.",
    "version": "0.1.0",
    "contact": {
      "name": "Emetry",
      "url": "https://emetry.ai/",
      "email": "hello@emetry.ai"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Health Check",
        "operationId": "health_check_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/claims": {
      "post": {
        "tags": [
          "claims"
        ],
        "summary": "Submit Claim",
        "operationId": "submit_claim_v1_claims_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitClaimRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "claims"
        ],
        "summary": "List Claims",
        "operationId": "list_claims_v1_claims_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClaimStatusResponse"
                  },
                  "title": "Response List Claims V1 Claims Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/claims/{claim_id}": {
      "get": {
        "tags": [
          "claims"
        ],
        "summary": "Get Claim",
        "operationId": "get_claim_v1_claims__claim_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "claim_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Claim Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/claims/{claim_id}/evidence": {
      "get": {
        "tags": [
          "claims"
        ],
        "summary": "Get Claim Evidence",
        "operationId": "get_claim_evidence_v1_claims__claim_id__evidence_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "claim_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Claim Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Claim Evidence V1 Claims  Claim Id  Evidence Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/escrow": {
      "get": {
        "tags": [
          "escrow"
        ],
        "summary": "List Escrows",
        "operationId": "list_escrows_v1_escrow_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EscrowStatusResponse"
                  },
                  "type": "array",
                  "title": "Response List Escrows V1 Escrow Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "escrow"
        ],
        "summary": "Fund Escrow",
        "operationId": "fund_escrow_v1_escrow_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FundEscrowRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundEscrowResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/v1/escrow/{claim_id}": {
      "get": {
        "tags": [
          "escrow"
        ],
        "summary": "Get Escrow",
        "operationId": "get_escrow_v1_escrow__claim_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "claim_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Claim Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/escrow/{claim_id}/refund": {
      "post": {
        "tags": [
          "escrow"
        ],
        "summary": "Refund Escrow",
        "operationId": "refund_escrow_v1_escrow__claim_id__refund_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "claim_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Claim Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ClaimDetailResponse": {
        "properties": {
          "claim_id": {
            "type": "string",
            "format": "uuid",
            "title": "Claim Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "claim_type": {
            "type": "string",
            "title": "Claim Type"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "evidence_count": {
            "type": "integer",
            "title": "Evidence Count",
            "default": 0
          },
          "verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verdict"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "latitude": {
            "type": "number",
            "title": "Latitude"
          },
          "longitude": {
            "type": "number",
            "title": "Longitude"
          },
          "bounty_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bounty Amount"
          },
          "verifier_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verifier Id"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "claim_id",
          "status",
          "title",
          "claim_type",
          "created_at",
          "description",
          "latitude",
          "longitude",
          "bounty_amount",
          "verifier_id",
          "expires_at",
          "updated_at"
        ],
        "title": "ClaimDetailResponse"
      },
      "ClaimStatusResponse": {
        "properties": {
          "claim_id": {
            "type": "string",
            "format": "uuid",
            "title": "Claim Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "claim_type": {
            "type": "string",
            "title": "Claim Type"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "evidence_count": {
            "type": "integer",
            "title": "Evidence Count",
            "default": 0
          },
          "verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verdict"
          }
        },
        "type": "object",
        "required": [
          "claim_id",
          "status",
          "title",
          "claim_type",
          "created_at"
        ],
        "title": "ClaimStatusResponse"
      },
      "EscrowStatusResponse": {
        "properties": {
          "escrow_id": {
            "type": "string",
            "format": "uuid",
            "title": "Escrow Id"
          },
          "claim_id": {
            "type": "string",
            "format": "uuid",
            "title": "Claim Id"
          },
          "consumer_id": {
            "type": "string",
            "format": "uuid",
            "title": "Consumer Id"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "commission_rate": {
            "type": "number",
            "title": "Commission Rate"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "escrow_id",
          "claim_id",
          "consumer_id",
          "amount",
          "commission_rate",
          "currency",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "EscrowStatusResponse"
      },
      "FundEscrowRequest": {
        "properties": {
          "claim_id": {
            "type": "string",
            "format": "uuid",
            "title": "Claim Id"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "usd"
          }
        },
        "type": "object",
        "required": [
          "claim_id",
          "amount"
        ],
        "title": "FundEscrowRequest"
      },
      "FundEscrowResponse": {
        "properties": {
          "escrow": {
            "$ref": "#/components/schemas/EscrowStatusResponse"
          },
          "client_secret": {
            "type": "string",
            "title": "Client Secret"
          }
        },
        "type": "object",
        "required": [
          "escrow",
          "client_secret"
        ],
        "title": "FundEscrowResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HealthResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "default": "healthy"
          },
          "service": {
            "type": "string",
            "title": "Service",
            "default": "gateway"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "default": "0.1.0"
          }
        },
        "type": "object",
        "title": "HealthResponse"
      },
      "SubmitClaimRequest": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "claim_type": {
            "type": "string",
            "title": "Claim Type",
            "default": "photo"
          },
          "latitude": {
            "type": "number",
            "title": "Latitude"
          },
          "longitude": {
            "type": "number",
            "title": "Longitude"
          },
          "radius_meters": {
            "type": "number",
            "title": "Radius Meters",
            "default": 500.0
          },
          "bounty_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bounty Amount"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "title",
          "description",
          "latitude",
          "longitude"
        ],
        "title": "SubmitClaimRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.emetry.ai",
      "description": "Production (private beta)"
    }
  ]
}