{"components":{"schemas":{"AgentAnswer":{"properties":{"data":{"$ref":"#/components/schemas/AgentData"},"metadata":{"$ref":"#/components/schemas/Metadata"},"text":{"description":"A complete sentence: pair, rate, governorate, tier, date, and the reminder that the board prints per 100.","type":"string"}},"required":["text","data"],"type":"object"},"AgentData":{"properties":{"board":{"description":"The public board showing the same pair per 100 units.","type":"string"},"pair":{"properties":{"base":{"type":"string"},"quote":{"type":"string"}},"required":["base","quote"],"type":"object"},"rate":{"$ref":"#/components/schemas/Rate"},"scope":{"description":"The OCHA scope the rate was priced in.","type":"string"},"source":{"type":"string"}},"required":["pair","scope","rate"],"type":"object"},"AgentError":{"properties":{"error":{"$ref":"#/components/schemas/AgentErrorBody"},"id":{"type":"integer"},"jsonrpc":{"type":"string"}},"type":"object"},"AgentErrorBody":{"properties":{"code":{"description":"JSON-RPC code: -32601 unsupported method, -32700 body is not an envelope, -32602 missing question.","type":"integer"},"data":{"type":"object"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"AgentMessage":{"properties":{"error":{"$ref":"#/components/schemas/AgentErrorBody"},"id":{"type":"integer"},"jsonrpc":{"type":"string"},"result":{"properties":{"contextId":{"type":"string"},"kind":{"enum":["message"],"type":"string"},"messageId":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"parts":{"items":{"properties":{"data":{"$ref":"#/components/schemas/AgentData"},"kind":{"enum":["text","data"],"type":"string"},"text":{"type":"string"}},"type":"object"},"type":"array"},"role":{"enum":["agent"],"type":"string"}},"type":"object"}},"required":["jsonrpc","result"],"type":"object"},"Metadata":{"properties":{"asOf":{"description":"UTC timestamp of the answer.","type":"string"},"plan":{"description":"Always `open` here: the agent is unmetered. Plan codes belong to the keyed rate API.","type":"string"},"quota":{"description":"`none` — this answer did not consume a quota.","type":"string"},"tier":{"description":"Where the number came from; the text part names it.","type":"string"},"units":{"type":"string"}},"type":"object"},"Rate":{"properties":{"base":{"type":"string"},"date":{"description":"Baghdad calendar day, YYYY-MM-DD.","type":"string"},"quote":{"type":"string"},"rate":{"description":"Quote units per 1 unit of the base. The public board prints 100× this number.","type":"number"}},"required":["date","base","quote","rate"],"type":"object"}},"securitySchemes":{"apiKey":{"description":"The keyed rate API's `iqx_…` key (https://iqdrates.com/account). Not required by askRates or sendA2AMessage — the agent is unmetered, and a key sent to it is accepted and ignored.","scheme":"bearer","type":"http"}}},"info":{"contact":{"name":"IQ Xchange","url":"https://iqdrates.com/docs"},"description":"Use `askRates` for any question about an exchange rate, a price in dinars, or the history behind them. It answers with a sentence a model can quote and the same JSON object the rate API returns. Numbers are per 1 unit of the base currency (USD/IQD = 1513.44); the public board prints per 100 (151,344), because the Iraqi bazaar quotes per $100 — never mix the two. Every answer names its tier: `desk` is the market quote read from a monitored trading channel, `reference` is the ECB rate via Frankfurter converted through the dollar pivot. `askRates` and `sendA2AMessage` need no key and are not metered — call them as often as a conversation needs, just not faster than once a minute. `getRate` is the metered product and needs `Authorization: Bearer iqx_…`. Informational only, not financial advice.","summary":"Live USD/IQD and cross-currency rates for Iraq, priced per governorate and labelled by tier.","title":"IQ Xchange — Iraqi Dinar exchange rates","version":"0.1.0"},"openapi":"3.1.0","paths":{"/a2a":{"post":{"description":"The protocol-native form, for clients that already speak A2A. `message/send` answers with a Message (never a Task): `parts[0]` is the sentence, `parts[1]` the data object. Unsupported methods answer JSON-RPC `-32601`. If your platform only passes simple arguments, use askRates instead. Unmetered: no key, no allowance.","operationId":"sendA2AMessage","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"description":"Echoed in the reply.","type":"integer"},"jsonrpc":{"enum":["2.0"],"type":"string"},"method":{"enum":["message/send"],"type":"string"},"params":{"properties":{"message":{"properties":{"contextId":{"description":"Optional conversation id, echoed back.","type":"string"},"parts":{"items":{"properties":{"kind":{"enum":["text"],"type":"string"},"text":{"description":"The question, e.g. \"USD to IQD rate in Erbil\".","type":"string"}},"required":["kind","text"],"type":"object"},"type":"array"},"role":{"enum":["user"],"type":"string"}},"required":["role","parts"],"type":"object"}},"required":["message"],"type":"object"}},"required":["jsonrpc","method","params"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMessage"}}},"description":"A JSON-RPC reply carrying an agent Message."}},"summary":"Send an A2A JSON-RPC message"}},"/a2a/ask":{"get":{"description":"Answer a question such as \"USD to IQD in Erbil\" with the current mid rate. Returns `text` (a complete sentence naming the pair, the rate, the governorate, the tier and the date) and `data` (the rate object). Reads the pair, the governorate and the word \"archive\" out of the sentence. Costs nothing: no key, no allowance, no quota — call it as often as a conversation needs. Use this for every rate question; attributes to IQ Xchange (iqdrates.com).","operationId":"askRates","parameters":[{"description":"The question in prose, in Arabic, Kurdish, English or Turkish — for example \"USD to IQD in Erbil\" or \"سعر الدولار في بغداد\". If omitted, pass base and quote.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"ISO code of the base currency, e.g. USD. Used when q is omitted.","in":"query","name":"base","required":false,"schema":{"type":"string"}},{"description":"ISO code of the quote currency, e.g. IQD. Used when q is omitted.","in":"query","name":"quote","required":false,"schema":{"type":"string"}},{"description":"OCHA scope for a governorate: ADM2:IQG08 Baghdad, ADM2:IQG11 Erbil, ADM2:IQG06 Sulaymaniyah, ADM2:IQG09 Duhok, ADM2:IQG02 Basra, ADM2:IQG04 Najaf. Overrides a governorate named in q; this node defaults to ADM2:IQG08.","in":"query","name":"scope","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAnswer"}}},"description":"The rate and the sentence that quotes it."}},"summary":"Ask for an Iraqi dinar rate in plain language"}},"/archive/meta":{"get":{"description":"First and last stored day, the number of days, desk-quoted versus reference days, and which governorates hold data. Free, no key. Use it when a question is about history rather than today's rate.","operationId":"archiveCoverage","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Coverage of the USD/IQD archive."}},"summary":"How far the daily archive reaches"}},"/v2/rate/{base}/{quote}":{"get":{"description":"The machine endpoint. Requires `Authorization: Bearer iqx_…` and counts against the package's daily budget. Returns the rate per 1 unit of the base currency.","operationId":"getRate","parameters":[{"description":"Base currency, e.g. USD.","in":"path","name":"base","required":true,"schema":{"type":"string"}},{"description":"Quote currency, e.g. IQD.","in":"path","name":"quote","required":true,"schema":{"type":"string"}},{"description":"OCHA scope, e.g. ADM2:IQG11.","in":"query","name":"scope","required":false,"schema":{"type":"string"}},{"description":"Set to `providers` to add the legs behind the number, with bid/ask where the desk has them.","in":"query","name":"expand","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rate"}}},"description":"The rate."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}},"description":"Missing or invalid key."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}},"description":"Daily quota spent."}},"security":[{"apiKey":[]}],"servers":[{"description":"keyed JSON rate API","url":"https://fx.iqdrates.com"}],"summary":"Current rate for one pair (needs a key)"}}},"servers":[{"description":"agent and archive — key optional","url":"https://iqdrates.com"},{"description":"keyed JSON rate API","url":"https://fx.iqdrates.com"}]}