{"openapi":"3.0.3","info":{"title":"میاکد (miacode) public API","version":"1.0.0","description":"Read-only endpoints for public plans and desktop releases. price is Iranian rials. Do not use this document for account, billing, login, or admin calls."},"servers":[{"url":"https://miacode.ir"}],"paths":{"/api":{"get":{"operationId":"getPublicApiIndex","description":"List the public read endpoints an agent may call without authentication.","responses":{"200":{"description":"Index of public read endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiIndex"}}}},"405":{"description":"Method is not GET.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/plans":{"get":{"operationId":"listPublicPlans","description":"Return current plans. Use public=true entries for prices shown on the site. price is Iranian rials; displayed Toman is price divided by 10.","responses":{"200":{"description":"Public plan catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanList"}}}},"405":{"description":"Method is not GET.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Plans could not be loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/plans/{plan_id}":{"get":{"operationId":"getPublicPlan","description":"Return one plan by numeric id from listPublicPlans.","parameters":[{"name":"plan_id","in":"path","required":true,"description":"Integer plan id.","schema":{"type":"integer"}}],"responses":{"200":{"description":"One plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"400":{"description":"plan_id is not an integer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No plan with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method is not GET.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Plan could not be loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/releases":{"get":{"operationId":"listLatestReleases","description":"Return the latest desktop download files grouped by Windows, macOS, and Linux.","responses":{"200":{"description":"Latest release files per platform.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseList"}}}},"405":{"description":"Method is not GET.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Releases could not be loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["code","message","resolution"],"properties":{"code":{"type":"string","description":"Stable error code."},"message":{"type":"string","description":"What failed."},"resolution":{"type":"string","description":"What the caller should do next."},"detail":{"type":"string","description":"Same text as message, kept for existing clients."}}},"Plan":{"type":"object","required":["name","price","public"],"properties":{"id":{"type":"integer","nullable":true},"name":{"type":"string"},"price":{"type":"number","description":"Price in Iranian rials. The website displays Toman, which is price divided by 10."},"message_allowance":{"type":"number"},"period":{"type":"string","description":"ISO-8601 duration, usually P30D."},"models_list":{"type":"string"},"credits":{"type":"number"},"public":{"type":"boolean"}}},"PlanList":{"type":"object","required":["plans"],"properties":{"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}}}},"ReleaseFile":{"type":"object","required":["name","url"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"version":{"type":"string"},"timestamp":{"type":"number"},"size":{"type":"number"}}},"PlatformDownload":{"type":"object","required":["platform","label","files"],"properties":{"platform":{"type":"string","enum":["windows","mac","linux"]},"label":{"type":"string"},"files":{"type":"array","items":{"type":"object","required":["name","url"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"version":{"type":"string"},"timestamp":{"type":"number"},"size":{"type":"number"}}}}}},"ReleaseList":{"type":"object","required":["platforms"],"properties":{"platforms":{"type":"array","items":{"$ref":"#/components/schemas/PlatformDownload"}}}},"ApiIndex":{"type":"object","required":["openapi","endpoints"],"properties":{"openapi":{"type":"string"},"llms":{"type":"string"},"sitemap":{"type":"string"},"endpoints":{"type":"array","items":{"type":"object","required":["method","path","operationId","description"],"properties":{"method":{"type":"string"},"path":{"type":"string"},"operationId":{"type":"string"},"description":{"type":"string"}}}}}}}}}