{
    "openapi": "3.1.0",
    "info": {
        "title": "Nakordoni Developer API — Account Usage API",
        "version": "2026-12-04",
        "summary": "REST + JSON over HTTPS. One base URL, one key, predictable envelopes.",
        "description": "Generated from the Nakordoni Developer API endpoint registry (the same source as https://nakordoni.eu/api/v1/docs.md). Path-versioned per endpoint: /api/v1/… is stable; /api/v2/… and newer serve the newer behaviour only for the endpoints listed. Free key: https://nakordoni.eu/en/developers/signup",
        "termsOfService": "https://nakordoni.eu/en/p/developer_api_terms",
        "contact": {
            "name": "Nakordoni Developer Portal",
            "url": "https://nakordoni.eu/en/developers"
        },
        "license": {
            "name": "Nakordoni Developer API Terms",
            "url": "https://nakordoni.eu/en/p/developer_api_terms"
        }
    },
    "externalDocs": {
        "description": "API documentation",
        "url": "https://nakordoni.eu/en/developers/docs/account-usage"
    },
    "servers": [
        {
            "url": "https://nakordoni.eu",
            "description": "Production"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        },
        {
            "apiKeyHeader": []
        },
        {
            "apiKeyQuery": []
        }
    ],
    "tags": [
        {
            "name": "account-usage",
            "description": "Account Usage API",
            "externalDocs": {
                "url": "https://nakordoni.eu/en/developers/docs/account-usage"
            }
        }
    ],
    "paths": {
        "/api/v2/data/account-usage": {
            "get": {
                "tags": [
                    "account-usage"
                ],
                "summary": "Account Usage API",
                "description": "What is left of your limits right now, for the key you call with: plan, per-second cap, and for each daily quota class (cheap, heavy, route) the limit, units used, units remaining and when the counter resets (midnight UTC). Also your approved countries as this key sees them and where to upgrade. Not metered — reading it never uses quota — and limited to 30 calls per minute per key. The numbers are the same ones the X-Devapi-Limit / X-Devapi-Remaining headers carry on every metered call.\n\nExample: `/api/v2/account/usage`\n\nHuman docs: https://nakordoni.eu/en/developers/docs/account-usage",
                "operationId": "accountUsageV2",
                "responses": {
                    "200": {
                        "description": "Successful response (shared envelope; `data` as documented).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/ApiEnvelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "plan": {
                                                            "description": "Your plan: slug and display name."
                                                        },
                                                        "qps": {
                                                            "description": "Per-second request cap that applies to this key now."
                                                        },
                                                        "quotas": {
                                                            "type": "object",
                                                            "properties": {
                                                                "cheap": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "limit": {
                                                                            "description": "Daily allowance of the standard class; heavy and route have the same four fields."
                                                                        },
                                                                        "used": {
                                                                            "description": "Units spent today with this key."
                                                                        },
                                                                        "remaining": {
                                                                            "description": "Units left today — equals X-Devapi-Remaining."
                                                                        },
                                                                        "reset_at": {
                                                                            "description": "When the counter resets, ISO-8601 UTC (midnight UTC). The X-Devapi-Reset header gives the same moment as a Unix timestamp."
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "markets": {
                                                            "type": "object",
                                                            "properties": {
                                                                "approved": {
                                                                    "description": "Countries this key may use. Countries switched on through an integration work only with that integration's key."
                                                                },
                                                                "allowed": {
                                                                    "description": "How many countries the plan allows; null = unlimited."
                                                                },
                                                                "available": {
                                                                    "description": "Integration keys only: the integration's countries you do not have yet (null for other keys)."
                                                                },
                                                                "key_bound": {
                                                                    "description": "true when some approved countries belong to one key only, so another key can see a different list."
                                                                }
                                                            }
                                                        },
                                                        "upgrade_url": {
                                                            "description": "Billing page in your account language — upgrade the plan or add extra countries."
                                                        },
                                                        "pass": {
                                                            "description": "Integration keys only: Trip Pass state {active, expires_at, days_left}; null for other keys."
                                                        },
                                                        "pass_url": {
                                                            "description": "Integration keys only: link to the Trip Pass on the Billing page (account language); null for other keys."
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/E400"
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "410": {
                        "$ref": "#/components/responses/E410"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    },
                    "500": {
                        "$ref": "#/components/responses/E500"
                    },
                    "503": {
                        "$ref": "#/components/responses/E503"
                    },
                    "504": {
                        "$ref": "#/components/responses/E504"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "NKD-DEV-XXXX-XXXX-XXXX",
                "description": "API key from https://nakordoni.eu/en/developers, sent as `Authorization: Bearer NKD-DEV-…` (preferred)."
            },
            "apiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key",
                "description": "Same API key in the X-API-Key header."
            },
            "apiKeyQuery": {
                "type": "apiKey",
                "in": "query",
                "name": "key",
                "description": "Same API key as ?key= (fallback; keys in URLs end up in logs)."
            }
        },
        "schemas": {
            "ApiEnvelope": {
                "type": "object",
                "required": [
                    "ok"
                ],
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": true
                    },
                    "api_version": {
                        "type": "string",
                        "description": "Version that served the call, e.g. \"1\", \"v2\"."
                    },
                    "product": {
                        "type": "string"
                    },
                    "attribution": {
                        "type": "string",
                        "description": "Show this attribution with the data."
                    },
                    "data": {
                        "description": "Product payload — shape per product, see the operation."
                    },
                    "snapshot": {
                        "type": "object"
                    },
                    "usage": {
                        "type": "object",
                        "properties": {
                            "requests_today": {
                                "type": "integer"
                            },
                            "limit_today": {
                                "type": "integer"
                            },
                            "remaining": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "ApiError": {
                "type": "object",
                "required": [
                    "ok",
                    "error"
                ],
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": false
                    },
                    "api_version": {
                        "type": "string"
                    },
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "examples": [
                                    "bad_request",
                                    "missing_api_key",
                                    "invalid_api_key",
                                    "product_unavailable",
                                    "unknown_product",
                                    "version_sunset",
                                    "qps_exceeded",
                                    "quota_exceeded",
                                    "internal_error",
                                    "busy",
                                    "timeout"
                                ]
                            },
                            "message": {
                                "type": "string"
                            },
                            "docs": {
                                "type": "string",
                                "format": "uri"
                            },
                            "developer_portal": {
                                "type": "string",
                                "format": "uri"
                            }
                        },
                        "additionalProperties": true
                    }
                }
            }
        },
        "responses": {
            "E400": {
                "description": "Bad request (bad_request, invalid_country, unsupported_version, geocode_failed, scope_required, …).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E401": {
                "description": "Missing API key (missing_api_key).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E403": {
                "description": "Key invalid, blocked or not allowed for this product (invalid_api_key, product_unavailable, not_approved, …).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E404": {
                "description": "Unknown product (unknown_product).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E410": {
                "description": "Version retired (version_sunset, version_closed_to_new_accounts).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E429": {
                "description": "Rate or quota limit (qps_exceeded, quota_exceeded, duplicate_request, ip_temporarily_blocked). See Retry-After.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E500": {
                "description": "Internal error (internal_error).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E503": {
                "description": "Temporarily unavailable (busy).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E504": {
                "description": "Upstream timeout (timeout).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            }
        }
    }
}
