Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Lathe customer Access API
description: 'Manage your Lathe instances from code or from an AI agent.
**Authentication.** Create an API key on the Access page of the portal and send it as
`Authorization: Bearer lathe_…`. Keys act as the customer who created them; they cannot create or
revoke other keys.
**Creating an instance.** Where `GET /plans` offers Free, `POST /instances` with `tier: "free"` creates a $0 instance immediately, with no card or checkout; it returns `checkout_url: null`. Free has 1000 GB outbound traffic per month and no daily backups. A paid plan returns `checkout_url`:
open it in a browser and pay; the instance is provisioned as soon as the payment page returns and
the response''s `instance_id` is valid from the start (poll `GET /instances/{id}` - its `status` goes
`awaiting_payment` → `pending` → `creating` → `running`; `payment_failed` if the card was declined,
`error` if creation failed). A coupon that covers the whole first month skips the page. Every paid
purchase goes through the hosted page, card on file or not. Where the trial is offered (`GET /plans` →
`trial`), a customer''s first Mini starts with a 14-day free trial and the response says `trial: true`.
With `trial.card = "later"` the instance is created at once (`status: pending`, no `checkout_url`) and it is kept
from the portal''s billing page before the trial ends; without that it pauses and is deleted a week later. What
keeping it costs depends on the gateway: where a card can be verified and held, adding one charges nothing and the
first month is charged when the trial ends; where the provider holds the subscription itself there is no such page,
so keeping the instance is the purchase and the first month is charged at once, ending the trial there. With
`trial.card = "start"`, `checkout_url` verifies the card first (a temporary $1 authorisation that is released) and
the first month is charged when the trial ends.
**Slow operations are jobs.** Reset, restore, rotate, allowlist, upgrade, SQL console and delete
answer `202` with a `job_id`; one job runs per instance at a time and the instance answers `409`
while one is queued or running. Destructive actions (reset, restore, delete) require
`confirm` to equal the instance id. (The portal asks for the instance''s name instead, since that is what a
person knows; either is accepted.)
The same operations are available to AI agents over MCP: the server is the MCP host itself, no path.'
version: '1.0'
servers:
- url: /api/v1
tags:
- name: Access
paths:
/instances/{instance_id}/access:
post:
tags:
- Access
summary: 'Temporary credentials: the connection view with a lease per engine that expires…'
operationId: access_issue_instances__instance_id__access_post
parameters:
- name: instance_id
in: path
required: true
schema:
type: string
title: Instance Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/AccessIn'
- type: 'null'
title: Body
responses:
'201':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Access Issue Instances Instance Id Access Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/access:
get:
tags:
- Access
summary: The live temporary credentials on the account (no secrets)
operationId: access_list_access_get
parameters:
- name: instance_id
in: query
required: false
schema:
type: string
description: Only this instance's.
default: ''
title: Instance Id
description: Only this instance's.
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Access List Access Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/access/{lease_id}/refresh:
post:
tags:
- Access
summary: Extend a temporary credential; answers approval_required with a page for the…
operationId: access_refresh_access__lease_id__refresh_post
parameters:
- name: lease_id
in: path
required: true
schema:
type: string
title: Lease Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/AccessRefreshIn'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Access Refresh Access Lease Id Refresh Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/access/{lease_id}:
delete:
tags:
- Access
summary: End a temporary credential now
operationId: access_revoke_access__lease_id__delete
parameters:
- name: lease_id
in: path
required: true
schema:
type: string
title: Lease Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Access Revoke Access Lease Id Delete
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
AccessRefreshIn:
properties:
ttl_minutes:
anyOf:
- type: integer
- type: 'null'
title: Ttl Minutes
description: How long from now, 5 to 720 minutes; 60 when omitted.
type: object
title: AccessRefreshIn
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
AccessIn:
properties:
engines:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Engines
description: Which engines to lease; omit for every engine on the box that takes one.
ttl_minutes:
anyOf:
- type: integer
- type: 'null'
title: Ttl Minutes
description: 'How long the credentials work, 5 to 720 minutes; 60 when omitted. The auth engine''s key: at most 60.'
type: object
title: AccessIn
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError