{"openapi":"3.1.0","info":{"title":"Fiat Agent API","version":"1.0.0","summary":"Live and historical exchange rates as JSON, served from Fiat Agent's own store.","description":"Two GET endpoints, one response shape. The open endpoint needs no key and answers with current rates plus the full catalogue; the keyed endpoint adds stored history and draws down the account's balance. Every response carries the timestamp of the reading behind it.","contact":{"name":"Fiat Agent support","url":"https://fiatagent.base44.app/contact"},"license":{"name":"Terms of service","url":"https://fiatagent.base44.app/terms"}},"servers":[{"url":"https://fiatagent.base44.app","description":"Production"}],"tags":[{"name":"Rates","description":"Exchange rate readings"}],"paths":{"/api/v1/public/rates":{"get":{"tags":["Rates"],"operationId":"getPublicRates","summary":"Current rates, no key","description":"Open endpoint. Answered from the stored reading. Limited to 5 per second, 50 per hour, 50 per day per client.","parameters":[{"name":"base","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z]{3}$"},"description":"ISO 4217 code to quote against. Every value is re-quoted by division; the stored base is unchanged.","example":"EUR"}],"responses":{"200":{"description":"Current reading and the full currency catalogue.","headers":{"x-ratelimit-limit":{"schema":{"type":"integer"},"description":"Allowed in the tightest window."},"x-ratelimit-remaining":{"schema":{"type":"integer"},"description":"Left in that window after this call."},"x-ratelimit-reset":{"schema":{"type":"integer"},"description":"Seconds until that window rolls over."}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"endpoint":{"type":"string"},"generated_at":{"type":"string","format":"date-time"},"meta":{"type":"object","properties":{"base_currency":{"type":"string"},"currency_count":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"},"tier":{"type":"string","const":"public"},"limits":{"type":"array","items":{"type":"object","properties":{"window":{"type":"string"},"limit":{"type":"integer"}}}}}},"data":{"type":"object","properties":{"latest":{"type":"object","required":["base_currency","updated_at","currency_count","rates"],"properties":{"base_currency":{"type":"string","example":"USD"},"updated_at":{"type":"string","format":"date-time","description":"When the stored reading was fetched."},"currency_count":{"type":"integer"},"rates":{"type":"object","description":"Currency code to quote, relative to the response's base_currency. Cross rates are the quotient of two quotes.","additionalProperties":{"type":"number"},"example":{"USD":1,"EUR":0.8956}}}},"currencies":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"flag":{"type":"string"},"rate":{"type":["number","null"]}}}}}}}}}}},"400":{"description":"A parameter was unsupported or malformed.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_parameter","unsupported_parameter","invalid_base","missing_key","invalid_key","revoked_key","rate_limited","service_busy"]},"message":{"type":"string","description":"Written to be read by a person."},"parameter":{"type":"string","description":"The query parameter at fault, when one is."}}}}}}}},"429":{"description":"A public window is spent.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_parameter","unsupported_parameter","invalid_base","missing_key","invalid_key","revoked_key","rate_limited","service_busy"]},"message":{"type":"string","description":"Written to be read by a person."},"parameter":{"type":"string","description":"The query parameter at fault, when one is."}}}}}}}},"503":{"description":"The store could not be read in time. See retry-after.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_parameter","unsupported_parameter","invalid_base","missing_key","invalid_key","revoked_key","rate_limited","service_busy"]},"message":{"type":"string","description":"Written to be read by a person."},"parameter":{"type":"string","description":"The query parameter at fault, when one is."}}}}}}}}}}},"/api/v1/rates":{"get":{"tags":["Rates"],"operationId":"getRates","summary":"Current rates plus stored history, with an account key","description":"Keyed endpoint. Draws one request from the account's balance, never refused for volume but held to per-key burst windows. Returns current rates, the catalogue, up to 2000 stored readings and a freshness block separating our fetch time from the source's publication time.","security":[{"bearerKey":[]}],"parameters":[{"name":"base","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z]{3}$"},"description":"ISO 4217 code to quote against. Every value is re-quoted by division; the stored base is unchanged.","example":"EUR"},{"name":"snapshots","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":2000,"default":2000},"description":"How many stored readings to return, newest first."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First UTC day to include, written as YYYY-MM-DD."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last UTC day to include, inclusive."}],"responses":{"200":{"description":"Current reading, catalogue and stored history.","headers":{"x-quota-limit":{"schema":{"type":"integer"},"description":"The account's total balance."},"x-quota-remaining":{"schema":{"type":"integer"},"description":"Left after this call."}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"endpoint":{"type":"string"},"generated_at":{"type":"string","format":"date-time"},"meta":{"type":"object","properties":{"base_currency":{"type":"string"},"currency_count":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"},"snapshot_count":{"type":"integer"},"tier":{"type":"string","const":"account"},"quota":{"type":"object","properties":{"limit":{"type":"integer","description":"Signup bonus plus top-ups. Starts at 5000."},"used":{"type":"integer"},"remaining":{"type":"integer"}}}}},"data":{"type":"object","properties":{"latest":{"type":"object","required":["base_currency","updated_at","currency_count","rates"],"properties":{"base_currency":{"type":"string","example":"USD"},"updated_at":{"type":"string","format":"date-time","description":"When the stored reading was fetched."},"currency_count":{"type":"integer"},"rates":{"type":"object","description":"Currency code to quote, relative to the response's base_currency. Cross rates are the quotient of two quotes.","additionalProperties":{"type":"number"},"example":{"USD":1,"EUR":0.8956}}}},"currencies":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"flag":{"type":"string"},"rate":{"type":["number","null"]}}}},"snapshots":{"type":"array","items":{"type":"object","properties":{"fetched_at":{"type":"string","format":"date-time"},"base_currency":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"currency_count":{"type":"integer"},"rates":{"type":"object","description":"Currency code to quote, relative to the response's base_currency. Cross rates are the quotient of two quotes.","additionalProperties":{"type":"number"},"example":{"USD":1,"EUR":0.8956}}}}}}}}}}}},"400":{"description":"A parameter was unsupported or malformed.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_parameter","unsupported_parameter","invalid_base","missing_key","invalid_key","revoked_key","rate_limited","service_busy"]},"message":{"type":"string","description":"Written to be read by a person."},"parameter":{"type":"string","description":"The query parameter at fault, when one is."}}}}}}}},"401":{"description":"The key was missing, unknown or revoked.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_parameter","unsupported_parameter","invalid_base","missing_key","invalid_key","revoked_key","rate_limited","service_busy"]},"message":{"type":"string","description":"Written to be read by a person."},"parameter":{"type":"string","description":"The query parameter at fault, when one is."}}}}}}}},"503":{"description":"The store could not be read in time. See retry-after.","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_parameter","unsupported_parameter","invalid_base","missing_key","invalid_key","revoked_key","rate_limited","service_busy"]},"message":{"type":"string","description":"Written to be read by a person."},"parameter":{"type":"string","description":"The query parameter at fault, when one is."}}}}}}}}}}}},"components":{"securitySchemes":{"bearerKey":{"type":"http","scheme":"bearer","description":"An API key from your account, prefixed fiatagent_. Shown once when created."}}}}