Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceErrors

ErrorsTools · rule

ai.usage_unavailable

On this page

The app's AI usage couldn't be read from its database, because it can't be reached or has no table for it yet.

Area 14, Tools; not declinable; the next step is usually the human's.

Why Jadpo refuses it

jadpo ai usage shows the tokens the app's ai calls used today and this month, from the counts ai: { limits: } keeps in a table of the limits' database. The table comes with the project's migrations. When the database can't be reached, or has no such table, there are no counts to show, so the command stops.

Jadpo won't apply the migrations for you here or try another address. The database may be production's, and whether it is the right one only you know.

What it looks like

A project whose ai: sets a daily limit, kept in its database main:

app.jadpo:

example
application {    connections: {        main: {            driver: Driver.postgres            url: config.database_url        }        local_model: {            driver: Driver.openai_compatible            url: config.model_url        }    }    ai: {        connection: local_model        models: {            default: config.drafting_model        }        limits: {            per_day: {                tokens: 2000000            }        }    }}

jadpo ai usage against a new database, to which the project's migrations haven't been applied:

shell
jadpo ai usage
jadpo ai

error The database main has no table for AI usage yet

reason
jadpo_ai_usage comes with the project's migrations, so either the database hasn't applied them, or it isn't this project's database.
next
Run jadpo migrate apply if it is this project's database, then run the command again (human)
rule
ai.usage_unavailable
help
https://jadpo.dev/docs/errors/ai.usage_unavailable

(human) at the end of the next: line tells your coding agent to stop and ask you which fix you want, because the choice is yours to make: it decides which database the command reads, and whether its schema changes.

A database whose server isn't running gives the same error, saying it can't be reached. Here DATABASE_URL, the variable the connection's setting reads, names a database on this machine with no server running:

shell
DATABASE_URL=postgresql://localhost:5499/app jadpo ai usage
jadpo ai

error The database main can't be reached

reason
Connecting to it failed, so no AI usage could be read.
next
Check the database is running and its address is right, then run the command again (human)
rule
ai.usage_unavailable
help
https://jadpo.dev/docs/errors/ai.usage_unavailable

How to fix it

The question is whether the address names this project's database.

If it is this project's database, not yet migrated, apply the migrations, then run the command again:

shell
jadpo migrate applyjadpo ai usage

The tables are made, and the command reads them.

If its server isn't running, start the server, then run the command again:

shell
jadpo ai usage

The command reaches the database and reads it.

If the address names another database than the one you meant, such as production's, name that one with --url:

shell
jadpo ai usage --url "$PRODUCTION_DATABASE_URL"

The command reads that database instead, and leaves the other alone.

Markdown for agents: /docs/errors/ai.usage_unavailable.md.Built from Jadpo main at aee2e8f.