{
  "openapi": "3.1.0",
  "info": {
    "title": "Aquedra Run API",
    "version": "0.1.0",
    "summary": "Metered GIS tools for agents, paid from prepaid credits.",
    "description": "Each call is priced before it runs: send dry_run to read the price without charging, and max_cost_usd to refuse a call that would cost more. Money is decimal text in US dollars. The same tools are available over MCP at /mcp. Prices are the current ones; /pricing.json lists them, and llms.txt summarizes the API. Human-readable prices: https://r.aquedra.com/pricing.",
    "contact": {
      "name": "Aquedra Run",
      "url": "https://aquedra.com/contact"
    },
    "termsOfService": "https://r.aquedra.com/terms",
    "x-logo": {
      "url": "https://r.aquedra.com/icon-512.png",
      "altText": "Aquedra Run"
    }
  },
  "externalDocs": {
    "description": "Quick start, connection instructions and prices",
    "url": "https://r.aquedra.com/docs"
  },
  "servers": [
    {
      "url": "https://r.aquedra.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "GIS",
      "description": "Paid GIS operations."
    },
    {
      "name": "Inference",
      "description": "Chat on Run’s own GPUs, best effort."
    },
    {
      "name": "Account",
      "description": "Balance and credit purchases."
    }
  ],
  "paths": {
    "/v1": {
      "get": {
        "operationId": "index",
        "summary": "List the API's routes",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The routes, and where the machine-readable documents are.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {
                    "usage": "/v1/usage",
                    "purchase": "/v1/credits/purchase",
                    "geo": "/v1/geo/{coordinates|reproject|measure|transform|convert}",
                    "chat_completions": "/v1/chat/completions",
                    "models": "/v1/models",
                    "mcp": "/mcp",
                    "openapi": "/openapi.json",
                    "llms": "/llms.txt",
                    "pricing": "/pricing.json"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "usage",
        "summary": "Read the balance, level, limits and recent credit movements",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "balance_usd is decimal text in US dollars.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                },
                "example": {
                  "data": {
                    "balance_usd": "5.000000",
                    "level": "paid",
                    "trial": {
                      "granted": false
                    },
                    "purchases_enabled": true,
                    "recent": [
                      {
                        "kind": "GRANT",
                        "amount_usd": "5.000000",
                        "note": null,
                        "created_at": "2026-11-20T12:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/credits/purchase": {
      "post": {
        "operationId": "purchase_credits",
        "summary": "Buy a credit pack (1 credit = US$1)",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Packs of US$5, US$20, US$50, US$100. With method \"card\" the answer has a checkout_url that a person pays in their browser; this route never charges a card. With method \"usdc\" and no payment the answer is 402 with an x402 payment request; retry with the signed payment in the PAYMENT-SIGNATURE header.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Repeats of the same key return the first answer."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "pack_usd"
                ],
                "properties": {
                  "pack_usd": {
                    "enum": [
                      5,
                      20,
                      50,
                      100
                    ],
                    "description": "Credit pack in US dollars."
                  },
                  "method": {
                    "enum": [
                      "card",
                      "usdc"
                    ],
                    "default": "card",
                    "description": "card returns a checkout_url; usdc pays over x402."
                  }
                }
              },
              "example": {
                "pack_usd": 5,
                "method": "card"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "USDC settled over x402: the credits were added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {
                    "payment_id": "pay_example",
                    "credited_usd": "5.000000",
                    "balance_usd": "10.000000"
                  }
                }
              }
            }
          },
          "201": {
            "description": "Card: the checkout to complete in a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {
                    "payment_id": "pay_example",
                    "checkout_url": "https://checkout.stripe.com/c/pay/example"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "USDC without a payment: the x402 payment request, in the PAYMENT-REQUIRED header and the body.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "validation_failed: The body does not match the operation's schema; the message names the field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "validation_failed": {
                    "value": {
                      "error": {
                        "code": "validation_failed",
                        "message": "The body does not match the operation's schema; the message names the field.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/geo/coordinates": {
      "post": {
        "operationId": "geo_coordinates",
        "summary": "Convert coordinates",
        "description": "Convert up to 1,000 points between decimal degrees, degrees-minutes-seconds and UTM (WGS84). Costs US$0.001 per unit (max(1, ceil(points / 1000)): up to 1,000 points are 1 unit) from prepaid credits; with the default 3 s it is charged only when it succeeds, and invalid input is never charged. With max_seconds from 4 to 30 each second over the 3 included costs US$0.0005: the full time is held up front, the unused part is refunded, and the price and the time used are charged if the call runs out of time or memory, or is cancelled while running; any other failure is refunded in full. The same operation is the MCP tool convert_coordinates.",
        "tags": [
          "GIS"
        ],
        "x-price": {
          "amount_usd": "0.001",
          "unit": "unit",
          "unit_rule": "max(1, ceil(points / 1000)): up to 1,000 points are 1 unit",
          "extended_second_usd": "0.0005",
          "included_seconds": 3
        },
        "x-mcp-tool": "convert_coordinates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "enum": [
                      "dd",
                      "dms",
                      "utm"
                    ],
                    "description": "Format of the input points: dd (decimal degrees), dms (degrees-minutes-seconds text) or utm."
                  },
                  "to": {
                    "minItems": 1,
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "dd",
                        "dms",
                        "utm"
                      ]
                    },
                    "description": "Output formats to return for every point (1 to 3 of dd, dms, utm)."
                  },
                  "points": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "lat": {
                              "type": "number",
                              "minimum": -90,
                              "maximum": 90,
                              "description": "Latitude in decimal degrees (-90 to 90)."
                            },
                            "lon": {
                              "type": "number",
                              "minimum": -180,
                              "maximum": 180,
                              "description": "Longitude in decimal degrees (-180 to 180)."
                            }
                          },
                          "required": [
                            "lat",
                            "lon"
                          ]
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200,
                          "description": "Latitude then longitude as degrees-minutes-seconds text, e.g. 33°26'56\"S 70°40'09\"W (separated by a space, comma or semicolon)."
                        },
                        {
                          "type": "object",
                          "properties": {
                            "zone": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60,
                              "description": "UTM zone number (1 to 60)."
                            },
                            "hemisphere": {
                              "type": "string",
                              "enum": [
                                "N",
                                "S"
                              ],
                              "description": "UTM hemisphere: N or S."
                            },
                            "easting": {
                              "type": "number",
                              "description": "UTM easting in meters."
                            },
                            "northing": {
                              "type": "number",
                              "description": "UTM northing in meters."
                            }
                          },
                          "required": [
                            "zone",
                            "hemisphere",
                            "easting",
                            "northing"
                          ]
                        }
                      ]
                    },
                    "description": "Up to 1000 points. Each is {lat, lon} for dd, a text for dms, or {zone, hemisphere, easting, northing} for utm, matching `from`."
                  },
                  "dry_run": {
                    "description": "When true, return the price (cost_usd) and units of this call without running it or charging anything.",
                    "type": "boolean"
                  },
                  "max_cost_usd": {
                    "description": "The most this call may cost, in USD, as a number or decimal text with at most 6 decimals (e.g. 0.01 or \"0.01\"). A call that would cost more is refused with 402 max_cost_exceeded and nothing is charged.",
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "max_seconds": {
                    "description": "Compute time limit in seconds, 1 to 30 (default 3; 1 to 3 all use the standard 3 s). The price includes 3 s of compute. From 4 to 30 (extended time) the call runs on a separate lane, where buffer accepts larger inputs, and each second over 3 costs the geo_compute_second price: the price plus all those seconds is held at the start (that is what dry_run reports and max_cost_usd is compared with), the seconds not used are refunded, and the response adds compute_ms and max_seconds. With extended time the price and the time used are charged if the call runs out of time or memory, or is cancelled while running: 422 operation_too_complex keeps the whole hold, 422 operation_too_large or 413 result_too_large (a result over 8 MiB) or 499 cancelled keep the price and the seconds used, and those errors carry cost_usd. Any other failure is refunded in full.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                },
                "required": [
                  "from",
                  "to",
                  "points"
                ],
                "description": "Convert points between decimal degrees, degrees-minutes-seconds and UTM."
              },
              "example": {
                "from": "dd",
                "to": [
                  "dms",
                  "utm"
                ],
                "points": [
                  {
                    "lat": -33.45,
                    "lon": -70.65
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, what the call cost and the balance after it. With dry_run, only the price and units, with nothing charged.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "What the call was charged, USD as decimal text (0.000000 with dry_run).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Echo of the request's X-Request-Id, or a generated one.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoResponse"
                },
                "example": {
                  "data": {
                    "result": {
                      "points": [
                        {
                          "dms": {
                            "lat": "33° 27' 0.00\" S",
                            "lon": "70° 39' 0.00\" W"
                          },
                          "utm": {
                            "zone": 19,
                            "hemisphere": "S",
                            "easting": 346642.69499889173,
                            "northing": 6297606.832481072,
                            "epsg": "EPSG:32719"
                          }
                        }
                      ]
                    },
                    "cost_usd": "0.001000",
                    "units": 1,
                    "call_id": "0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10",
                    "balance_usd": "4.999000"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json: The request body is not valid JSON (REST only).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": {
                        "code": "invalid_json",
                        "message": "The request body is not valid JSON (REST only).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase. max_cost_exceeded: The price (with max_seconds over 3, the hold) is above max_cost_usd.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "insufficient_credits": {
                    "value": {
                      "error": {
                        "code": "insufficient_credits",
                        "message": "The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "max_cost_exceeded": {
                    "value": {
                      "error": {
                        "code": "max_cost_exceeded",
                        "message": "The price (with max_seconds over 3, the hold) is above max_cost_usd.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found: Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large: The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size). result_too_large: The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "payload_too_large": {
                    "value": {
                      "error": {
                        "code": "payload_too_large",
                        "message": "The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "result_too_large": {
                    "value": {
                      "error": {
                        "code": "result_too_large",
                        "message": "The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation_failed: The body does not match the operation's schema; the message names the field. invalid_geometry: A GeoJSON geometry is invalid or degenerate. invalid_file: The file content cannot be read as the stated input_format. operation_too_complex: The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30. operation_too_large: The operation ran out of memory; simplify or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "validation_failed": {
                    "value": {
                      "error": {
                        "code": "validation_failed",
                        "message": "The body does not match the operation's schema; the message names the field.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_geometry": {
                    "value": {
                      "error": {
                        "code": "invalid_geometry",
                        "message": "A GeoJSON geometry is invalid or degenerate.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_file": {
                    "value": {
                      "error": {
                        "code": "invalid_file",
                        "message": "The file content cannot be read as the stated input_format.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_complex": {
                    "value": {
                      "error": {
                        "code": "operation_too_complex",
                        "message": "The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_large": {
                    "value": {
                      "error": {
                        "code": "operation_too_large",
                        "message": "The operation ran out of memory; simplify or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "daily_spend_cap: The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC. too_many_concurrent: This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1). rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "daily_spend_cap": {
                    "value": {
                      "error": {
                        "code": "daily_spend_cap",
                        "message": "The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "too_many_concurrent": {
                    "value": {
                      "error": {
                        "code": "too_many_concurrent",
                        "message": "This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "499": {
            "description": "cancelled: The client closed the request while the call was queued or running.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "cancelled": {
                    "value": {
                      "error": {
                        "code": "cancelled",
                        "message": "The client closed the request while the call was queued or running.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal_error: An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "internal_error": {
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy: The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "busy": {
                    "value": {
                      "error": {
                        "code": "busy",
                        "message": "The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/geo/reproject": {
      "post": {
        "operationId": "geo_reproject",
        "summary": "Reproject GeoJSON",
        "description": "Reproject every coordinate of a GeoJSON between coordinate reference systems such as EPSG:4326, EPSG:3857 and the WGS84 UTM zones. Costs US$0.001 per unit (max(1, ceil(features / 1000), ceil(vertices / 10000)): up to 1,000 features and 10,000 vertices are 1 unit) from prepaid credits; with the default 3 s it is charged only when it succeeds, and invalid input is never charged. With max_seconds from 4 to 30 each second over the 3 included costs US$0.0005: the full time is held up front, the unused part is refunded, and the price and the time used are charged if the call runs out of time or memory, or is cancelled while running; any other failure is refunded in full. The same operation is the MCP tool reproject_geojson.",
        "tags": [
          "GIS"
        ],
        "x-price": {
          "amount_usd": "0.001",
          "unit": "unit",
          "unit_rule": "max(1, ceil(features / 1000), ceil(vertices / 10000)): up to 1,000 features and 10,000 vertices are 1 unit",
          "extended_second_usd": "0.0005",
          "included_seconds": 3
        },
        "x-mcp-tool": "reproject_geojson",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "geojson": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": {},
                    "description": "GeoJSON object: a FeatureCollection, a Feature or a bare geometry, in WGS84 longitude/latitude unless a CRS is stated. Limits: 50,000 features and 200,000 vertices. An operation that runs past its compute or memory limit fails with 422 operation_too_complex or operation_too_large."
                  },
                  "from_crs": {
                    "type": "string",
                    "pattern": "^EPSG:\\d+$",
                    "description": "CRS of the input coordinates, as EPSG:<n>."
                  },
                  "to_crs": {
                    "type": "string",
                    "pattern": "^EPSG:\\d+$",
                    "description": "CRS to convert the coordinates to, as EPSG:<n>."
                  },
                  "dry_run": {
                    "description": "When true, return the price (cost_usd) and units of this call without running it or charging anything.",
                    "type": "boolean"
                  },
                  "max_cost_usd": {
                    "description": "The most this call may cost, in USD, as a number or decimal text with at most 6 decimals (e.g. 0.01 or \"0.01\"). A call that would cost more is refused with 402 max_cost_exceeded and nothing is charged.",
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "max_seconds": {
                    "description": "Compute time limit in seconds, 1 to 30 (default 3; 1 to 3 all use the standard 3 s). The price includes 3 s of compute. From 4 to 30 (extended time) the call runs on a separate lane, where buffer accepts larger inputs, and each second over 3 costs the geo_compute_second price: the price plus all those seconds is held at the start (that is what dry_run reports and max_cost_usd is compared with), the seconds not used are refunded, and the response adds compute_ms and max_seconds. With extended time the price and the time used are charged if the call runs out of time or memory, or is cancelled while running: 422 operation_too_complex keeps the whole hold, 422 operation_too_large or 413 result_too_large (a result over 8 MiB) or 499 cancelled keep the price and the seconds used, and those errors carry cost_usd. Any other failure is refunded in full.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                },
                "required": [
                  "geojson",
                  "from_crs",
                  "to_crs"
                ],
                "description": "Reproject every coordinate of a GeoJSON between two coordinate reference systems."
              },
              "example": {
                "geojson": {
                  "type": "Point",
                  "coordinates": [
                    -70.65,
                    -33.45
                  ]
                },
                "from_crs": "EPSG:4326",
                "to_crs": "EPSG:3857"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, what the call cost and the balance after it. With dry_run, only the price and units, with nothing charged.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "What the call was charged, USD as decimal text (0.000000 with dry_run).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Echo of the request's X-Request-Id, or a generated one.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoResponse"
                },
                "example": {
                  "data": {
                    "result": {
                      "geojson": {
                        "type": "FeatureCollection",
                        "features": [
                          {
                            "type": "Feature",
                            "geometry": {
                              "type": "Point",
                              "coordinates": [
                                -7864722.024544778,
                                -3955187.399354618
                              ]
                            },
                            "properties": {}
                          }
                        ]
                      }
                    },
                    "cost_usd": "0.001000",
                    "units": 1,
                    "call_id": "0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10",
                    "balance_usd": "4.999000"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json: The request body is not valid JSON (REST only).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": {
                        "code": "invalid_json",
                        "message": "The request body is not valid JSON (REST only).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase. max_cost_exceeded: The price (with max_seconds over 3, the hold) is above max_cost_usd.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "insufficient_credits": {
                    "value": {
                      "error": {
                        "code": "insufficient_credits",
                        "message": "The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "max_cost_exceeded": {
                    "value": {
                      "error": {
                        "code": "max_cost_exceeded",
                        "message": "The price (with max_seconds over 3, the hold) is above max_cost_usd.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found: Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large: The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size). result_too_large: The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "payload_too_large": {
                    "value": {
                      "error": {
                        "code": "payload_too_large",
                        "message": "The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "result_too_large": {
                    "value": {
                      "error": {
                        "code": "result_too_large",
                        "message": "The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation_failed: The body does not match the operation's schema; the message names the field. invalid_geometry: A GeoJSON geometry is invalid or degenerate. invalid_file: The file content cannot be read as the stated input_format. operation_too_complex: The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30. operation_too_large: The operation ran out of memory; simplify or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "validation_failed": {
                    "value": {
                      "error": {
                        "code": "validation_failed",
                        "message": "The body does not match the operation's schema; the message names the field.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_geometry": {
                    "value": {
                      "error": {
                        "code": "invalid_geometry",
                        "message": "A GeoJSON geometry is invalid or degenerate.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_file": {
                    "value": {
                      "error": {
                        "code": "invalid_file",
                        "message": "The file content cannot be read as the stated input_format.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_complex": {
                    "value": {
                      "error": {
                        "code": "operation_too_complex",
                        "message": "The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_large": {
                    "value": {
                      "error": {
                        "code": "operation_too_large",
                        "message": "The operation ran out of memory; simplify or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "daily_spend_cap: The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC. too_many_concurrent: This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1). rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "daily_spend_cap": {
                    "value": {
                      "error": {
                        "code": "daily_spend_cap",
                        "message": "The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "too_many_concurrent": {
                    "value": {
                      "error": {
                        "code": "too_many_concurrent",
                        "message": "This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "499": {
            "description": "cancelled: The client closed the request while the call was queued or running.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "cancelled": {
                    "value": {
                      "error": {
                        "code": "cancelled",
                        "message": "The client closed the request while the call was queued or running.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal_error: An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "internal_error": {
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy: The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "busy": {
                    "value": {
                      "error": {
                        "code": "busy",
                        "message": "The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/geo/measure": {
      "post": {
        "operationId": "geo_measure",
        "summary": "Measure GeoJSON",
        "description": "Measure the geodesic area, perimeter and length of each feature of a GeoJSON, with totals, in square meters and meters. Costs US$0.001 per unit (max(1, ceil(features / 1000), ceil(vertices / 10000)): up to 1,000 features and 10,000 vertices are 1 unit) from prepaid credits; with the default 3 s it is charged only when it succeeds, and invalid input is never charged. With max_seconds from 4 to 30 each second over the 3 included costs US$0.0005: the full time is held up front, the unused part is refunded, and the price and the time used are charged if the call runs out of time or memory, or is cancelled while running; any other failure is refunded in full. The same operation is the MCP tool measure_geojson.",
        "tags": [
          "GIS"
        ],
        "x-price": {
          "amount_usd": "0.001",
          "unit": "unit",
          "unit_rule": "max(1, ceil(features / 1000), ceil(vertices / 10000)): up to 1,000 features and 10,000 vertices are 1 unit",
          "extended_second_usd": "0.0005",
          "included_seconds": 3
        },
        "x-mcp-tool": "measure_geojson",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "geojson": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": {},
                    "description": "GeoJSON object: a FeatureCollection, a Feature or a bare geometry, in WGS84 longitude/latitude unless a CRS is stated. Limits: 50,000 features and 200,000 vertices. An operation that runs past its compute or memory limit fails with 422 operation_too_complex or operation_too_large."
                  },
                  "dry_run": {
                    "description": "When true, return the price (cost_usd) and units of this call without running it or charging anything.",
                    "type": "boolean"
                  },
                  "max_cost_usd": {
                    "description": "The most this call may cost, in USD, as a number or decimal text with at most 6 decimals (e.g. 0.01 or \"0.01\"). A call that would cost more is refused with 402 max_cost_exceeded and nothing is charged.",
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "max_seconds": {
                    "description": "Compute time limit in seconds, 1 to 30 (default 3; 1 to 3 all use the standard 3 s). The price includes 3 s of compute. From 4 to 30 (extended time) the call runs on a separate lane, where buffer accepts larger inputs, and each second over 3 costs the geo_compute_second price: the price plus all those seconds is held at the start (that is what dry_run reports and max_cost_usd is compared with), the seconds not used are refunded, and the response adds compute_ms and max_seconds. With extended time the price and the time used are charged if the call runs out of time or memory, or is cancelled while running: 422 operation_too_complex keeps the whole hold, 422 operation_too_large or 413 result_too_large (a result over 8 MiB) or 499 cancelled keep the price and the seconds used, and those errors carry cost_usd. Any other failure is refunded in full.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                },
                "required": [
                  "geojson"
                ],
                "description": "Measure geodesic area (m²), perimeter and length (m) of each feature in a GeoJSON. Polygons get area_m2 and perimeter_m, lines get length_m, points and GeometryCollection features get no measures."
              },
              "example": {
                "geojson": {
                  "type": "Feature",
                  "properties": {
                    "name": "Plot A"
                  },
                  "geometry": {
                    "type": "Polygon",
                    "coordinates": [
                      [
                        [
                          -70.65,
                          -33.45
                        ],
                        [
                          -70.64,
                          -33.45
                        ],
                        [
                          -70.64,
                          -33.44
                        ],
                        [
                          -70.65,
                          -33.44
                        ],
                        [
                          -70.65,
                          -33.45
                        ]
                      ]
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, what the call cost and the balance after it. With dry_run, only the price and units, with nothing charged.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "What the call was charged, USD as decimal text (0.000000 with dry_run).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Echo of the request's X-Request-Id, or a generated one.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoResponse"
                },
                "example": {
                  "data": {
                    "result": {
                      "features": [
                        {
                          "index": 0,
                          "geometry_type": "Polygon",
                          "area_m2": 1031699.8850028745,
                          "perimeter_m": 4079.559030916064
                        }
                      ],
                      "totals": {
                        "area_m2": 1031699.8850028745,
                        "length_m": 0
                      }
                    },
                    "cost_usd": "0.001000",
                    "units": 1,
                    "call_id": "0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10",
                    "balance_usd": "4.999000"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json: The request body is not valid JSON (REST only).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": {
                        "code": "invalid_json",
                        "message": "The request body is not valid JSON (REST only).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase. max_cost_exceeded: The price (with max_seconds over 3, the hold) is above max_cost_usd.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "insufficient_credits": {
                    "value": {
                      "error": {
                        "code": "insufficient_credits",
                        "message": "The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "max_cost_exceeded": {
                    "value": {
                      "error": {
                        "code": "max_cost_exceeded",
                        "message": "The price (with max_seconds over 3, the hold) is above max_cost_usd.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found: Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large: The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size). result_too_large: The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "payload_too_large": {
                    "value": {
                      "error": {
                        "code": "payload_too_large",
                        "message": "The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "result_too_large": {
                    "value": {
                      "error": {
                        "code": "result_too_large",
                        "message": "The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation_failed: The body does not match the operation's schema; the message names the field. invalid_geometry: A GeoJSON geometry is invalid or degenerate. invalid_file: The file content cannot be read as the stated input_format. operation_too_complex: The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30. operation_too_large: The operation ran out of memory; simplify or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "validation_failed": {
                    "value": {
                      "error": {
                        "code": "validation_failed",
                        "message": "The body does not match the operation's schema; the message names the field.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_geometry": {
                    "value": {
                      "error": {
                        "code": "invalid_geometry",
                        "message": "A GeoJSON geometry is invalid or degenerate.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_file": {
                    "value": {
                      "error": {
                        "code": "invalid_file",
                        "message": "The file content cannot be read as the stated input_format.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_complex": {
                    "value": {
                      "error": {
                        "code": "operation_too_complex",
                        "message": "The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_large": {
                    "value": {
                      "error": {
                        "code": "operation_too_large",
                        "message": "The operation ran out of memory; simplify or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "daily_spend_cap: The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC. too_many_concurrent: This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1). rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "daily_spend_cap": {
                    "value": {
                      "error": {
                        "code": "daily_spend_cap",
                        "message": "The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "too_many_concurrent": {
                    "value": {
                      "error": {
                        "code": "too_many_concurrent",
                        "message": "This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "499": {
            "description": "cancelled: The client closed the request while the call was queued or running.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "cancelled": {
                    "value": {
                      "error": {
                        "code": "cancelled",
                        "message": "The client closed the request while the call was queued or running.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal_error: An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "internal_error": {
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy: The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "busy": {
                    "value": {
                      "error": {
                        "code": "busy",
                        "message": "The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/geo/transform": {
      "post": {
        "operationId": "geo_transform",
        "summary": "Transform GeoJSON",
        "description": "Buffer, simplify, centroid, bounding box, convex hull or clean a GeoJSON, returning the resulting GeoJSON. Costs US$0.001 per unit (max(1, ceil(features / 1000), ceil(vertices / 10000)): up to 1,000 features and 10,000 vertices are 1 unit) from prepaid credits; with the default 3 s it is charged only when it succeeds, and invalid input is never charged. With max_seconds from 4 to 30 each second over the 3 included costs US$0.0005: the full time is held up front, the unused part is refunded, and the price and the time used are charged if the call runs out of time or memory, or is cancelled while running; any other failure is refunded in full. The same operation is the MCP tool transform_geojson.",
        "tags": [
          "GIS"
        ],
        "x-price": {
          "amount_usd": "0.001",
          "unit": "unit",
          "unit_rule": "max(1, ceil(features / 1000), ceil(vertices / 10000)): up to 1,000 features and 10,000 vertices are 1 unit",
          "extended_second_usd": "0.0005",
          "included_seconds": 3
        },
        "x-mcp-tool": "transform_geojson",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "geojson": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": {},
                    "description": "GeoJSON object: a FeatureCollection, a Feature or a bare geometry, in WGS84 longitude/latitude unless a CRS is stated. Limits: 50,000 features and 200,000 vertices. An operation that runs past its compute or memory limit fails with 422 operation_too_complex or operation_too_large."
                  },
                  "operation": {
                    "type": "string",
                    "enum": [
                      "buffer",
                      "simplify",
                      "centroid",
                      "bbox",
                      "convex_hull",
                      "clean"
                    ],
                    "description": "Operation: buffer, simplify, centroid, bbox, convex_hull, or clean (drops point features with empty, non-numeric, swapped, out-of-range or 0,0 coordinates)."
                  },
                  "distance_m": {
                    "description": "Buffer distance in meters (0 to 100000). Required for buffer. Buffer accepts at most 1,000 features, 4,000 vertices and 1,000 MultiPoint positions; with max_seconds above 3 (extended time), 5,000 features, 20,000 vertices and 5,000 MultiPoint positions.",
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100000
                  },
                  "tolerance_m": {
                    "description": "Simplify tolerance in meters, converted to degrees approximately (1 degree is about 111,320 m), so it is less exact away from the equator. Defaults to 10.",
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100000
                  },
                  "dry_run": {
                    "description": "When true, return the price (cost_usd) and units of this call without running it or charging anything.",
                    "type": "boolean"
                  },
                  "max_cost_usd": {
                    "description": "The most this call may cost, in USD, as a number or decimal text with at most 6 decimals (e.g. 0.01 or \"0.01\"). A call that would cost more is refused with 402 max_cost_exceeded and nothing is charged.",
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "max_seconds": {
                    "description": "Compute time limit in seconds, 1 to 30 (default 3; 1 to 3 all use the standard 3 s). The price includes 3 s of compute. From 4 to 30 (extended time) the call runs on a separate lane, where buffer accepts larger inputs, and each second over 3 costs the geo_compute_second price: the price plus all those seconds is held at the start (that is what dry_run reports and max_cost_usd is compared with), the seconds not used are refunded, and the response adds compute_ms and max_seconds. With extended time the price and the time used are charged if the call runs out of time or memory, or is cancelled while running: 422 operation_too_complex keeps the whole hold, 422 operation_too_large or 413 result_too_large (a result over 8 MiB) or 499 cancelled keep the price and the seconds used, and those errors carry cost_usd. Any other failure is refunded in full.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                },
                "required": [
                  "geojson",
                  "operation"
                ],
                "description": "Apply one geometric operation to a GeoJSON and return the resulting GeoJSON."
              },
              "example": {
                "geojson": {
                  "type": "Feature",
                  "properties": {
                    "name": "Plot A"
                  },
                  "geometry": {
                    "type": "Polygon",
                    "coordinates": [
                      [
                        [
                          -70.65,
                          -33.45
                        ],
                        [
                          -70.64,
                          -33.45
                        ],
                        [
                          -70.64,
                          -33.44
                        ],
                        [
                          -70.65,
                          -33.44
                        ],
                        [
                          -70.65,
                          -33.45
                        ]
                      ]
                    ]
                  }
                },
                "operation": "centroid"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, what the call cost and the balance after it. With dry_run, only the price and units, with nothing charged.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "What the call was charged, USD as decimal text (0.000000 with dry_run).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Echo of the request's X-Request-Id, or a generated one.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoResponse"
                },
                "example": {
                  "data": {
                    "result": {
                      "geojson": {
                        "type": "FeatureCollection",
                        "features": [
                          {
                            "type": "Feature",
                            "properties": {
                              "name": "Plot A"
                            },
                            "geometry": {
                              "type": "Point",
                              "coordinates": [
                                -70.64500000000001,
                                -33.445
                              ]
                            }
                          }
                        ]
                      }
                    },
                    "cost_usd": "0.001000",
                    "units": 1,
                    "call_id": "0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10",
                    "balance_usd": "4.999000"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json: The request body is not valid JSON (REST only).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": {
                        "code": "invalid_json",
                        "message": "The request body is not valid JSON (REST only).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase. max_cost_exceeded: The price (with max_seconds over 3, the hold) is above max_cost_usd.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "insufficient_credits": {
                    "value": {
                      "error": {
                        "code": "insufficient_credits",
                        "message": "The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "max_cost_exceeded": {
                    "value": {
                      "error": {
                        "code": "max_cost_exceeded",
                        "message": "The price (with max_seconds over 3, the hold) is above max_cost_usd.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found: Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large: The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size). result_too_large: The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "payload_too_large": {
                    "value": {
                      "error": {
                        "code": "payload_too_large",
                        "message": "The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "result_too_large": {
                    "value": {
                      "error": {
                        "code": "result_too_large",
                        "message": "The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation_failed: The body does not match the operation's schema; the message names the field. invalid_geometry: A GeoJSON geometry is invalid or degenerate. invalid_file: The file content cannot be read as the stated input_format. operation_too_complex: The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30. operation_too_large: The operation ran out of memory; simplify or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "validation_failed": {
                    "value": {
                      "error": {
                        "code": "validation_failed",
                        "message": "The body does not match the operation's schema; the message names the field.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_geometry": {
                    "value": {
                      "error": {
                        "code": "invalid_geometry",
                        "message": "A GeoJSON geometry is invalid or degenerate.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_file": {
                    "value": {
                      "error": {
                        "code": "invalid_file",
                        "message": "The file content cannot be read as the stated input_format.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_complex": {
                    "value": {
                      "error": {
                        "code": "operation_too_complex",
                        "message": "The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_large": {
                    "value": {
                      "error": {
                        "code": "operation_too_large",
                        "message": "The operation ran out of memory; simplify or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "daily_spend_cap: The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC. too_many_concurrent: This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1). rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "daily_spend_cap": {
                    "value": {
                      "error": {
                        "code": "daily_spend_cap",
                        "message": "The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "too_many_concurrent": {
                    "value": {
                      "error": {
                        "code": "too_many_concurrent",
                        "message": "This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "499": {
            "description": "cancelled: The client closed the request while the call was queued or running.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "cancelled": {
                    "value": {
                      "error": {
                        "code": "cancelled",
                        "message": "The client closed the request while the call was queued or running.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal_error: An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "internal_error": {
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy: The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "busy": {
                    "value": {
                      "error": {
                        "code": "busy",
                        "message": "The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/geo/convert": {
      "post": {
        "operationId": "geo_convert",
        "summary": "Convert geospatial file",
        "description": "Convert a geospatial file (CSV, KML, GPX, GeoJSON or zipped Shapefile) to GeoJSON, KML or CSV. Costs US$0.01 per file (1 per file (up to 1 MiB of arguments), whatever its number of features) from prepaid credits; with the default 3 s it is charged only when it succeeds, and invalid input is never charged. With max_seconds from 4 to 30 each second over the 3 included costs US$0.0005: the full time is held up front, the unused part is refunded, and the price and the time used are charged if the call runs out of time or memory, or is cancelled while running; any other failure is refunded in full. The same operation is the MCP tool convert_geo_file.",
        "tags": [
          "GIS"
        ],
        "x-price": {
          "amount_usd": "0.01",
          "unit": "file",
          "unit_rule": "1 per file (up to 1 MiB of arguments), whatever its number of features",
          "extended_second_usd": "0.0005",
          "included_seconds": 3
        },
        "x-mcp-tool": "convert_geo_file",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input_format": {
                    "type": "string",
                    "enum": [
                      "csv",
                      "kml",
                      "gpx",
                      "geojson",
                      "shapefile"
                    ],
                    "description": "Format of `content`."
                  },
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The file content as text. Size limits: csv 1 MiB (at most 200 columns, 50,000 rows and 200,000 cells), kml 1 MiB, gpx 1 MiB, geojson 1 MiB. For shapefile, a base64-encoded .zip (a bare .shp is not accepted) of up to ~750 KB (the whole request must fit in 1 MiB), which may expand to at most 8 MiB of .shp/.dbf/.prj/.cpg parts. csv and kml output accept at most 200 distinct property keys; csv output at most 200,000 cells (features x keys), kml output at most 20,000 features and 80,000 cells."
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "geojson",
                      "kml",
                      "csv"
                    ],
                    "description": "Format to convert to."
                  },
                  "x_field": {
                    "description": "CSV only: name of the longitude (x) column. Detected automatically when omitted.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "y_field": {
                    "description": "CSV only: name of the latitude (y) column. Detected automatically when omitted.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "dry_run": {
                    "description": "When true, return the price (cost_usd) and units of this call without running it or charging anything.",
                    "type": "boolean"
                  },
                  "max_cost_usd": {
                    "description": "The most this call may cost, in USD, as a number or decimal text with at most 6 decimals (e.g. 0.01 or \"0.01\"). A call that would cost more is refused with 402 max_cost_exceeded and nothing is charged.",
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "max_seconds": {
                    "description": "Compute time limit in seconds, 1 to 30 (default 3; 1 to 3 all use the standard 3 s). The price includes 3 s of compute. From 4 to 30 (extended time) the call runs on a separate lane, where buffer accepts larger inputs, and each second over 3 costs the geo_compute_second price: the price plus all those seconds is held at the start (that is what dry_run reports and max_cost_usd is compared with), the seconds not used are refunded, and the response adds compute_ms and max_seconds. With extended time the price and the time used are charged if the call runs out of time or memory, or is cancelled while running: 422 operation_too_complex keeps the whole hold, 422 operation_too_large or 413 result_too_large (a result over 8 MiB) or 499 cancelled keep the price and the seconds used, and those errors carry cost_usd. Any other failure is refunded in full.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                },
                "required": [
                  "input_format",
                  "content",
                  "output_format"
                ],
                "description": "Convert a geospatial file between CSV, KML, GPX, GeoJSON and Shapefile."
              },
              "example": {
                "input_format": "csv",
                "content": "name,lat,lon\nA,-33.45,-70.65\n",
                "output_format": "geojson"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, what the call cost and the balance after it. With dry_run, only the price and units, with nothing charged.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "What the call was charged, USD as decimal text (0.000000 with dry_run).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Echo of the request's X-Request-Id, or a generated one.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoResponse"
                },
                "example": {
                  "data": {
                    "result": {
                      "content": "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-70.65,-33.45]},\"properties\":{\"name\":\"A\"}}]}",
                      "output_format": "geojson",
                      "features": 1
                    },
                    "cost_usd": "0.010000",
                    "units": 1,
                    "call_id": "0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10",
                    "balance_usd": "4.990000"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json: The request body is not valid JSON (REST only).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": {
                        "code": "invalid_json",
                        "message": "The request body is not valid JSON (REST only).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase. max_cost_exceeded: The price (with max_seconds over 3, the hold) is above max_cost_usd.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "insufficient_credits": {
                    "value": {
                      "error": {
                        "code": "insufficient_credits",
                        "message": "The balance does not cover the price (with max_seconds over 3, the price plus the time held). Buy credits at POST /v1/credits/purchase.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "max_cost_exceeded": {
                    "value": {
                      "error": {
                        "code": "max_cost_exceeded",
                        "message": "The price (with max_seconds over 3, the hold) is above max_cost_usd.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found: Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "Unknown GIS operation in the path (REST only); use coordinates, reproject, measure, transform or convert.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large: The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size). result_too_large: The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "payload_too_large": {
                    "value": {
                      "error": {
                        "code": "payload_too_large",
                        "message": "The body or arguments are over 1 MiB, or the input is over a limit of the operation (features, vertices, points, file size).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "result_too_large": {
                    "value": {
                      "error": {
                        "code": "result_too_large",
                        "message": "The result is over 8 MiB; ask for GeoJSON or CSV output, or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation_failed: The body does not match the operation's schema; the message names the field. invalid_geometry: A GeoJSON geometry is invalid or degenerate. invalid_file: The file content cannot be read as the stated input_format. operation_too_complex: The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30. operation_too_large: The operation ran out of memory; simplify or split the input.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "validation_failed": {
                    "value": {
                      "error": {
                        "code": "validation_failed",
                        "message": "The body does not match the operation's schema; the message names the field.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_geometry": {
                    "value": {
                      "error": {
                        "code": "invalid_geometry",
                        "message": "A GeoJSON geometry is invalid or degenerate.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "invalid_file": {
                    "value": {
                      "error": {
                        "code": "invalid_file",
                        "message": "The file content cannot be read as the stated input_format.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_complex": {
                    "value": {
                      "error": {
                        "code": "operation_too_complex",
                        "message": "The operation did not finish within max_seconds (3 by default); simplify or split the input, or raise max_seconds up to 30.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "operation_too_large": {
                    "value": {
                      "error": {
                        "code": "operation_too_large",
                        "message": "The operation ran out of memory; simplify or split the input.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "daily_spend_cap: The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC. too_many_concurrent: This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1). rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "daily_spend_cap": {
                    "value": {
                      "error": {
                        "code": "daily_spend_cap",
                        "message": "The call would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "too_many_concurrent": {
                    "value": {
                      "error": {
                        "code": "too_many_concurrent",
                        "message": "This account already has its limit of GIS calls queued or running on that lane at the server that received the call (2 by default, counted per server, not across the whole service); wait for one to finish (Retry-After: 1).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "499": {
            "description": "cancelled: The client closed the request while the call was queued or running.",
            "headers": {
              "X-Run-Cost-Usd": {
                "description": "Present only when the call was still charged (extended time that ran out): what it cost, USD as decimal text, also in error.cost_usd.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "cancelled": {
                    "value": {
                      "error": {
                        "code": "cancelled",
                        "message": "The client closed the request while the call was queued or running.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "internal_error: An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "internal_error": {
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "An unexpected failure (REST). Over MCP the same failure is reported as the code unavailable. Retry shortly; quote the request_id if it persists.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy: The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "busy": {
                    "value": {
                      "error": {
                        "code": "busy",
                        "message": "The GIS service is full or the call waited too long for a worker; retry after Retry-After.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "chat_completions",
        "summary": "Chat completion on Run's own GPUs (OpenAI-compatible)",
        "description": "OpenAI-compatible: point an OpenAI SDK at the server's /v1 as base_url. Best effort: the GPUs are shared and their owner's other work has priority, so a busy GPU answers 503 gpu_busy with Retry-After and nothing is charged. Priced per token (US$ per million tokens, in x-price) with a minimum of US$0.0005 per call. The estimated prompt plus max_tokens is held first and the unused part is refunded; send dry_run to read the most a call can cost, and max_cost_usd to refuse a call that could cost more. max_tokens defaults to 1024; a larger one than 2048 is lowered to 2048, and the response's run (or the quote) then carries max_tokens and max_tokens_requested. qwen3-8b reasons before it answers: those tokens are not in content but count as output tokens and use up max_tokens, so send max_tokens of at least 1024. Images go only to qwen2.5-vl-7b, as up to 2 inline data: URLs of up to 512 KB each, which together must fit in the 1 MiB request. user, frequency_penalty and presence_penalty are accepted and ignored, as is stream_options; a field sent as null counts as not sent. Tools, response_format other than text, n other than 1, logprobs, embeddings and remote images are not supported and answer 422 unsupported_parameter (false, [] or tool_choice none ask for nothing and are accepted). Prompts and answers are not stored. The same operation is the MCP tool chat (without streaming).",
        "tags": [
          "Inference"
        ],
        "x-price": {
          "unit": "token",
          "min_call_usd": "0.0005",
          "models": [
            {
              "id": "qwen3-8b",
              "input_usd_per_mtok": "0.18",
              "output_usd_per_mtok": "0.70",
              "context_tokens": 8192,
              "max_output_tokens": 2048,
              "vision": false,
              "reasoning": true
            },
            {
              "id": "qwen2.5-3b",
              "input_usd_per_mtok": "0.05",
              "output_usd_per_mtok": "0.10",
              "context_tokens": 8192,
              "max_output_tokens": 2048,
              "vision": false,
              "reasoning": false
            },
            {
              "id": "qwen2.5-coder-7b",
              "input_usd_per_mtok": "0.025",
              "output_usd_per_mtok": "0.05",
              "context_tokens": 8192,
              "max_output_tokens": 2048,
              "vision": false,
              "reasoning": false
            },
            {
              "id": "qwen2.5-vl-7b",
              "input_usd_per_mtok": "0.18",
              "output_usd_per_mtok": "0.69",
              "context_tokens": 8192,
              "max_output_tokens": 2048,
              "vision": true,
              "reasoning": false
            }
          ]
        },
        "x-mcp-tool": "chat",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dry_run": {
                    "description": "When true, return the most this call can cost (cost_usd, the hold) and the max_tokens it assumes, without running it or charging anything.",
                    "type": "boolean"
                  },
                  "max_cost_usd": {
                    "description": "The most this call may cost, in USD, as a number or decimal text with at most 6 decimals (e.g. 0.01 or \"0.01\"). A call that would cost more is refused with 402 max_cost_exceeded and nothing is charged.",
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "model": {
                    "description": "Model id, default qwen3-8b. See GET /v1/models for the ones on sale.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "messages": {
                    "minItems": 1,
                    "maxItems": 64,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant"
                          ],
                          "description": "Who wrote the message. The tool role is not supported."
                        },
                        "content": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "text"
                                      },
                                      "text": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "text"
                                    ],
                                    "description": "A text part."
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "image_url"
                                      },
                                      "image_url": {
                                        "type": "object",
                                        "properties": {
                                          "url": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "url"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "image_url"
                                    ],
                                    "description": "An inline image as a data:image/png|jpeg|webp;base64 URL (qwen2.5-vl-7b only, up to 2 images of 512 KB each, which together must fit in the 1 MiB request)."
                                  }
                                ]
                              }
                            }
                          ],
                          "description": "The message text, or a list of text and image parts."
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    },
                    "description": "The conversation, 1 to 64 messages."
                  },
                  "stream": {
                    "description": "When true, the answer is sent as server-sent events (REST only, not MCP).",
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "max_tokens": {
                    "description": "Most tokens to generate, default 1024. A larger value than the output cap (max_output_tokens in GET /v1/models) is lowered to it, and the response says so in max_tokens and max_tokens_requested. qwen3-8b's reasoning counts toward it: send at least 1024.",
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "max_completion_tokens": {
                    "description": "Same as max_tokens; wins when both are sent.",
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "temperature": {
                    "description": "Sampling temperature, 0 to 2.",
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "top_p": {
                    "description": "Nucleus sampling, 0 to 1.",
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "stop": {
                    "description": "Up to 4 stop sequences of up to 64 characters each.",
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 64
                          },
                          {
                            "maxItems": 4,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 64
                            }
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "seed": {
                    "description": "Integer seed for repeatable sampling.",
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "messages"
                ]
              },
              "example": {
                "model": "qwen2.5-3b",
                "messages": [
                  {
                    "role": "user",
                    "content": "Say hello in one sentence."
                  }
                ],
                "max_tokens": 64,
                "max_cost_usd": "0.000500"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With stream false (the default) a chat.completion with the extra run field (what it cost, the balance after it, and max_tokens and max_tokens_requested when max_tokens was lowered). With stream true, server-sent events of chat.completion.chunk ending in data: [DONE]; the last chunk carries usage and run, and a failure mid-stream ends with data: {\"error\": {code, message, request_id}} instead of [DONE]. With dry_run, a run.quote with nothing charged.",
            "headers": {
              "X-Run-Call-Id": {
                "description": "Server-issued id of the call.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Run-Cost-Usd": {
                "description": "What the call cost (with dry_run, the hold), USD as decimal text; not sent with stream true.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Run-Balance-Usd": {
                "description": "Credit balance after the call (not sent with stream true).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Run-Hold-Usd": {
                "description": "stream true only: what was held before the first byte.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletion"
                },
                "example": {
                  "id": "chatcmpl-0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10",
                  "object": "chat.completion",
                  "created": 1795132800,
                  "model": "qwen2.5-3b",
                  "choices": [
                    {
                      "index": 0,
                      "message": {
                        "role": "assistant",
                        "content": "Hello! It's nice to meet you."
                      },
                      "finish_reason": "stop"
                    }
                  ],
                  "usage": {
                    "prompt_tokens": 15,
                    "completion_tokens": 9,
                    "total_tokens": 24
                  },
                  "run": {
                    "call_id": "0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10",
                    "cost_usd": "0.000500",
                    "balance_usd": "4.999500",
                    "hold_usd": "0.000500"
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-sent events: `data: {chat.completion.chunk}` lines, then `data: [DONE]`."
                },
                "example": "data: {\"id\":\"chatcmpl-0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10\",\"object\":\"chat.completion.chunk\",\"created\":1795132800,\"model\":\"qwen2.5-3b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"Hello! It's nice to meet you.\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10\",\"object\":\"chat.completion.chunk\",\"created\":1795132800,\"model\":\"qwen2.5-3b\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":15,\"completion_tokens\":9,\"total_tokens\":24},\"run\":{\"call_id\":\"0b7e6f3c-5d4a-4c1e-9a52-3f6f1d2c8e10\",\"cost_usd\":\"0.000500\",\"balance_usd\":\"4.999500\",\"hold_usd\":\"0.000500\"}}\n\ndata: [DONE]\n\n"
              }
            }
          },
          "400": {
            "description": "invalid_json: The request body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": {
                        "code": "invalid_json",
                        "message": "The request body is not valid JSON.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: The balance does not cover the hold (the estimated prompt plus max_tokens, at least the minimum per call). Lower max_tokens or buy credits at POST /v1/credits/purchase. max_cost_exceeded: The hold is above max_cost_usd; lower max_tokens or raise max_cost_usd.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "insufficient_credits": {
                    "value": {
                      "error": {
                        "code": "insufficient_credits",
                        "message": "The balance does not cover the hold (the estimated prompt plus max_tokens, at least the minimum per call). Lower max_tokens or buy credits at POST /v1/credits/purchase.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "max_cost_exceeded": {
                    "value": {
                      "error": {
                        "code": "max_cost_exceeded",
                        "message": "The hold is above max_cost_usd; lower max_tokens or raise max_cost_usd.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "model_not_found: The model is not on sale; GET /v1/models lists the ones that are.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "model_not_found": {
                    "value": {
                      "error": {
                        "code": "model_not_found",
                        "message": "The model is not on sale; GET /v1/models lists the ones that are.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large: The body is over 1 MiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "payload_too_large": {
                    "value": {
                      "error": {
                        "code": "payload_too_large",
                        "message": "The body is over 1 MiB.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation_failed: The body does not match the schema; the message names the field. unsupported_parameter: A field the service does not support (tools, response_format other than text, n other than 1, max_seconds, remote images, images on a text model); it is refused, never ignored. context_length_exceeded: The estimated prompt plus max_tokens is over 8192 tokens; shorten the messages or lower max_tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "validation_failed": {
                    "value": {
                      "error": {
                        "code": "validation_failed",
                        "message": "The body does not match the schema; the message names the field.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "unsupported_parameter": {
                    "value": {
                      "error": {
                        "code": "unsupported_parameter",
                        "message": "A field the service does not support (tools, response_format other than text, n other than 1, max_seconds, remote images, images on a text model); it is refused, never ignored.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "context_length_exceeded": {
                    "value": {
                      "error": {
                        "code": "context_length_exceeded",
                        "message": "The estimated prompt plus max_tokens is over 8192 tokens; shorten the messages or lower max_tokens.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "daily_spend_cap: The hold would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC. rate_limited: Too many requests: either the key's request limit or the account's inference calls per minute (a call answered gpu_busy counts too); retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "daily_spend_cap": {
                    "value": {
                      "error": {
                        "code": "daily_spend_cap",
                        "message": "The hold would pass the account's daily spend limit; Retry-After is the seconds until 00:00 UTC.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests: either the key's request limit or the account's inference calls per minute (a call answered gpu_busy counts too); retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "upstream_error: The GPU failed while answering; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "upstream_error": {
                    "value": {
                      "error": {
                        "code": "upstream_error",
                        "message": "The GPU failed while answering; retry later.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "gpu_busy: The GPU is busy (best effort: the GPUs are shared and their owner's other work has priority); retry after Retry-After. inference_unavailable: Inference is not available right now.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "gpu_busy": {
                    "value": {
                      "error": {
                        "code": "gpu_busy",
                        "message": "The GPU is busy (best effort: the GPUs are shared and their owner's other work has priority); retry after Retry-After.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  },
                  "inference_unavailable": {
                    "value": {
                      "error": {
                        "code": "inference_unavailable",
                        "message": "Inference is not available right now.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "upstream_timeout: The model did not finish within 90 s; lower max_tokens or retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "upstream_timeout": {
                    "value": {
                      "error": {
                        "code": "upstream_timeout",
                        "message": "The model did not finish within 90 s; lower max_tokens or retry.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "models",
        "summary": "List the models on sale with their prices",
        "tags": [
          "Inference"
        ],
        "responses": {
          "200": {
            "description": "OpenAI's model list; each model adds a run object with its per-million-token prices, minimum per call and limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "qwen3-8b",
                      "object": "model",
                      "owned_by": "aquedra-run",
                      "run": {
                        "kind": "chat",
                        "input_usd_per_mtok": "0.18",
                        "output_usd_per_mtok": "0.70",
                        "min_call_usd": "0.0005",
                        "context_tokens": 8192,
                        "max_output_tokens": 2048,
                        "vision": false,
                        "reasoning": true
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: Missing, invalid or revoked API key or access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "error": {
                        "code": "unauthorized",
                        "message": "Missing, invalid or revoked API key or access token.",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: Too many requests for the key; retry after Retry-After (60 s).",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "rate_limited": {
                    "value": {
                      "error": {
                        "code": "rate_limited",
                        "message": "Too many requests for the key; retry after Retry-After (60 s).",
                        "request_id": "4b1c2f1e-8a3d-4a8e-b0f1-6c1e5a7d9b21"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "rk_…",
        "description": "An API key (rk_…) from the dashboard, or the access token of a connected app, as Authorization: Bearer <key>."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "request_id"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable code."
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string",
                "description": "Echo of X-Request-Id; quote it in a report."
              },
              "cost_usd": {
                "type": "string",
                "description": "Only on a geo call that failed but was still charged: what it cost, USD as decimal text (also in the X-Run-Cost-Usd header)."
              }
            }
          }
        }
      },
      "GeoResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "cost_usd",
              "units"
            ],
            "properties": {
              "result": {
                "description": "The operation's result; absent with dry_run."
              },
              "cost_usd": {
                "type": "string",
                "description": "What the call cost, or would cost with dry_run (with max_seconds over 3, the hold), USD as decimal text."
              },
              "units": {
                "type": "integer",
                "description": "Price units the input measured."
              },
              "call_id": {
                "type": "string",
                "description": "Server-issued id of the call; absent with dry_run."
              },
              "balance_usd": {
                "type": "string",
                "description": "Credit balance after the charge; absent with dry_run."
              },
              "compute_ms": {
                "type": "integer",
                "description": "max_seconds over 3 only: the compute time the call was billed on, in milliseconds."
              },
              "max_seconds": {
                "type": "integer",
                "description": "max_seconds over 3 only: the limit the call ran (or would run) with."
              },
              "dry_run": {
                "const": true,
                "description": "Present when nothing was run or charged."
              }
            }
          }
        }
      },
      "ChatCompletion": {
        "type": "object",
        "required": [
          "id",
          "object",
          "choices",
          "usage",
          "run"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "chat.completion"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "const": "assistant"
                    },
                    "content": {
                      "type": "string"
                    }
                  }
                },
                "finish_reason": {
                  "enum": [
                    "stop",
                    "length"
                  ]
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "completion_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          },
          "run": {
            "type": "object",
            "description": "What Run charged for the call.",
            "required": [
              "call_id",
              "cost_usd",
              "balance_usd",
              "hold_usd"
            ],
            "properties": {
              "call_id": {
                "type": "string"
              },
              "cost_usd": {
                "type": "string"
              },
              "balance_usd": {
                "type": "string"
              },
              "hold_usd": {
                "type": "string"
              },
              "max_tokens": {
                "type": "integer",
                "description": "Only when the max_tokens asked for was above the output cap: the max_tokens used (the cap)."
              },
              "max_tokens_requested": {
                "type": "integer",
                "description": "Only when max_tokens was lowered: the max_tokens asked for."
              }
            }
          }
        }
      },
      "Usage": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "balance_usd": {
                "type": "string"
              },
              "level": {
                "type": "string"
              },
              "limits": {
                "type": "object"
              },
              "trial": {
                "type": "object",
                "properties": {
                  "granted": {
                    "type": "boolean"
                  }
                }
              },
              "purchases_enabled": {
                "type": "boolean"
              },
              "recent": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}