The Mokxi API

Tokens for scripts, CI and editor plugins, and what they can do.

What it is for

The API lets code do what you do in the editor: list your projects, read and write their files, and run a circuit to see whether it behaves. People use it to check a sketch on every push with a GitHub Action, to keep the code in their own editor while the circuit runs in Mokxi, and to script the boring parts.

Everything is on the developers page: a quick start, the limits for each plan, the error codes and every route.

Making a token

Open Settings on your account page and pick Developer. Give the token a name you will recognize later, tick the scopes it needs, and choose when it expires.

  • projects:read reads your projects and their files.
  • projects:write creates, changes and deletes them.
  • simulate runs circuits.

The token is shown once, right after you make it. Copy it then: Mokxi keeps only a scrambled copy and cannot show it again. If you lose it, revoke it and make another.

Signing in from a tool

The Mokxi CLI and editor plugins do not need a pasted token. They show you a short code and open mokxi.com/device. Check the name of the tool and what it asks for, then approve it. It gets a token of its own, which appears in your list like any other.

Only approve a code you started yourself, just now.

Revoking

Every token is listed under Developer with when it was last used and how much it did this month. Revoke stops it at once, wherever it is.

Limits

Each plan has its own limits on requests a minute, simulations an hour and how long one simulation may run. Free is enough to try things and to check a project on each push; the paid plans have ten times the room. The table is on the developers page.

Simulation minutes each month

Simulations also count toward a monthly allowance of simulated time, added up across all of your tokens:

  • Free: 100 minutes a month.
  • Pro and Student: 2,000 minutes a month.
  • Teacher and Classroom: 2,000 minutes a month, shared by the class. The teacher's runs and the runs of students in the teacher's paid classes all count toward the same total.
  • Schools and universities: we can set a larger number for you. Talk to us at mokxi.com/schools/quote.

The count starts over at midnight UTC on the first of each month. A simulation that starts before you reach the limit always finishes. Once the limit is reached, new simulations are turned away until the first of next month, with a message that says so. You are never charged for going over.

Developer in Settings shows how many minutes you have used this month, when the count starts over, and whether the total is shared with your class.