Jinn docs Console

API

The API is at https://api.usejinn.com/v1. It takes and returns JSON. The OpenAPI document describes every route and field.

Keys

Send an account key as a bearer token:

curl https://api.usejinn.com/v1/functions -H "Authorization: Bearer $JINN_KEY"

An owner makes keys in the console, under Account. jinn login makes one for the CLI. A key belongs to one account and shows once. An owner can revoke it at any time, and it stops at once.

ScopeWhat it can do
adminEverything in the account's functions, providers and runs.
runUpload files, start the functions it names, and read their runs.

Use a run key in services that only start runs.

Routes

RouteWhat it does
POST /v1/filesStart an upload: send bytes and sha256, then PUT the file to the returned url with the returned headers.
GET /v1/basesList the bases.
GET /v1/functionsList functions, each with its latest definition and last run.
POST /v1/functionsMake a function and its first version: name and a definition.
GET /v1/functions/{id}A function and its versions.
POST /v1/functions/{id}/versionsPublish the next version.
POST /v1/functions/{id}/runsStart a run.
GET /v1/runsList runs, newest first. Filter with function and state (active, succeeded, failed). Page with before (the next of the last page).
GET /v1/runs/{id}Read a run.
GET /v1/runs/{id}/logLinks to the run's log parts.
GET /v1/providersList providers and their versions.
POST /v1/providersMake a provider: name, model and key.
POST /v1/providers/{id}/versionsPublish a provider's next version.
POST /v1/catalogList the models a vendor key can use.
GET /v1/webhooks/public-keyThe account's webhook public key.

The console uses the same API with a person's sign-in. Routes for members, invites, keys and credit take a person's sign-in, not a key.

Errors

An error has a status and a JSON body: {"error": "what went wrong"}.

StatusMeaning
400The request is not valid. The error says which field.
401No key, or the key is wrong or revoked.
402The account has no credit.
403The key cannot do this, or the account is suspended.
404No such resource in this account.
409Two writes met. Try again.
429The account's runs would pass its memory limit.