varg.ai Account API
Identity and API key management
Identity and API key management
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/varg-ai:varg-ai-account-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a 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.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: varg Account API
version: 2.0.0
description: 'Unified REST API for AI media generation at `api.varg.ai/v2`.
One API key, ~80 models across 8 providers, async jobs, stable output URLs
on `s3.varg.ai`, files with lineage, and transparent billing: 1 credit =
1 cent = $0.01, and models are priced pass-through — you pay what the
provider charges, no markup. Every amount comes as integer credits
(`*_cents` / `credits` fields) and as dollars (`*_usd` fields).
**The async job pattern:** every generation request returns `202 Accepted`
with a job object (`status: queued`). Poll `GET /jobs/{id}` until the job
reaches a terminal status (`completed`, `failed`, or `cancelled`), then read
`output.outputs[0].url`. Alternatively, set `options.webhook_url` in the
request to receive an HMAC-signed callback when the job finishes.
**Rate limits** (sliding one-minute windows; a `429` carries `Retry-After`
and `X-RateLimit-*`):
- every request with an API key or session: 1,200 a minute per credential;
- every request without one: 120 a minute per IP;
- job submits: 60 a minute per key (300 across a team);
- keyless search (`GET /skills/search`): 3 a minute per IP, then
`429 sign_in_required` — sign in (`vargai login`) or send a key to keep
searching.'
servers:
- url: https://api.varg.ai/v2
security:
- bearerAuth: []
tags:
- name: Account
description: Identity and API key management
paths:
/me:
get:
tags:
- Account
operationId: getMe
summary: Get the authenticated account
responses:
'200':
description: Account identity
content:
application/json:
schema:
type: object
properties:
userId:
type: string
format: uuid
email:
type:
- string
- 'null'
teams:
type: array
description: Teams the user belongs to. Empty for an API key with no user behind it.
items:
$ref: '#/components/schemas/AccountTeam'
connection:
description: The OAuth connection's team binding; `null` unless the caller is an OAuth-delegated token (MCP, connectors).
oneOf:
- $ref: '#/components/schemas/AccountConnection'
- type: 'null'
'401':
$ref: '#/components/responses/Unauthorized'
/feedback:
post:
tags:
- Account
operationId: sendFeedback
summary: Send feedback about varg
description: 'Product feedback: a bug, an idea, praise, a complaint. Saved and
delivered to the varg team. Agents may send it on the user''s behalf
(the varg MCP `send_feedback` tool does). To rate one generated file,
use `POST /files/{id}/feedback` instead.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- message
properties:
kind:
type: string
enum:
- bug
- idea
- praise
- complaint
- other
default: other
message:
type: string
minLength: 1
maxLength: 4000
rating:
type: integer
minimum: 1
maximum: 5
source:
type: string
maxLength: 32
description: Where it was sent from (`mcp`, `api`, `app`). Default `api`.
client:
type: string
maxLength: 128
description: The client app, e.g. `claude-ai`. Defaults to the OAuth client id.
job_id:
type: string
description: The job the feedback is about.
file_id:
type: string
description: The file the feedback is about.
model:
type: string
description: The model the feedback is about.
context:
type: object
additionalProperties: true
description: Free-form extras (tool name, error text). At most 8000 bytes of JSON.
responses:
'201':
description: Feedback saved
content:
application/json:
schema:
type: object
properties:
id:
type: string
kind:
type: string
message:
type: string
rating:
type:
- integer
- 'null'
job_id:
type:
- string
- 'null'
file_id:
type:
- string
- 'null'
model:
type:
- string
- 'null'
notified:
type: boolean
description: Whether the push to the varg team went out.
created_at:
type: string
format: date-time
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
/api-keys:
get:
tags:
- Account
operationId: listApiKeys
summary: List API keys
description: Requires an app session (Supabase JWT), not an API key.
parameters:
- name: include
in: query
required: false
schema:
type: string
enum:
- shared
description: Pass `shared` to also list keys other people shared with you. Ignored when `X-Team-Id` is set.
- name: X-Team-Id
in: header
required: false
schema:
type: string
description: List the keys of this team instead of your own
responses:
'200':
description: API keys
content:
application/json:
schema:
type: object
properties:
api_keys:
type: array
items:
$ref: '#/components/schemas/ApiKey'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can manage API keys
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post:
tags:
- Account
operationId: createApiKey
summary: Create an API key
description: 'Creates a new API key. The plaintext key is returned **once** in the
`api_key` field — store it securely. Requires an app session (JWT).'
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 64
type:
type: string
enum:
- personal
- service
default: personal
revealable:
type: boolean
default: false
description: Keep an encrypted copy so the key can be shown again (`POST /api-keys/{id}/reveal`). Default `false` = shown once.
responses:
'201':
description: Key created
headers:
Cache-Control:
schema:
type: string
example: no-store
content:
application/json:
schema:
type: object
properties:
api_key:
type: string
description: The plaintext key — shown only once
example: varg_a1b2c3...
key:
$ref: '#/components/schemas/ApiKey'
'400':
description: Request failed validation (`invalid_request`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can create API keys
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Account key limit reached (`api_key_limit_reached`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Too many keys created (5 per hour per account) (`rate_limited`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api-keys/{id}:
patch:
tags:
- Account
operationId: renameApiKey
summary: Rename an API key
description: Requires an app session (Supabase JWT), not an API key.
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
minLength: 1
maxLength: 64
description: Trimmed before saving
responses:
'200':
description: Key renamed
content:
application/json:
schema:
type: object
required:
- key
properties:
key:
$ref: '#/components/schemas/ApiKey'
'400':
description: 'Validation failed: `name` empty or over 64 characters, or id not a UUID (`invalid_request`)'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can manage API keys (API keys and connected applications are rejected)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Unknown API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
delete:
tags:
- Account
operationId: revokeApiKey
summary: Revoke an API key
description: Requires an app session (Supabase JWT), not an API key.
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Key revoked
content:
application/json:
schema:
type: object
properties:
deleted:
type: boolean
revoked_at:
type: string
format: date-time
'400':
description: Id is not a UUID (`invalid_request`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can manage API keys (API keys and connected applications are rejected)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Unknown API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/me/connection:
get:
tags:
- Account
operationId: getMyConnection
summary: Get a connection's team binding
description: 'Returns which team (and default folder) an OAuth connection works in. Call it with a connected-app
token to read that connection''s own binding; an app session must pass `client_id`.
A connected app can only address itself. API keys have no connection and get 400.'
parameters:
- name: client_id
in: query
required: false
description: OAuth client id. Required for an app session; for a connected-app token it must be omitted or match the token's own client.
schema:
type: string
responses:
'200':
description: The binding, re-validated against current team membership
content:
application/json:
schema:
$ref: '#/components/schemas/AccountConnection'
'400':
description: API key used, or `client_id` missing for an app session (`invalid_request`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: A connected app asked about another client (`forbidden`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: The binding could not be read (`binding_unavailable`). Retry after the `Retry-After` interval.
headers:
Retry-After:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
put:
tags:
- Account
operationId: setMyConnection
summary: Set a connection's team binding
description: 'Binds an OAuth connection to a team and optional default folder. Send `team_id: null` (or omit it)
to move the connection back to the personal account. A connected app can only change its own
binding; an app session must pass `client_id` in the body. API keys have no connection and get 400.
Returns the stored binding.'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AccountConnectionRequest'
example:
team_id: 0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11
workspace_id: null
responses:
'200':
description: The stored binding
content:
application/json:
schema:
$ref: '#/components/schemas/AccountConnection'
'400':
description: Invalid body, API key used, or `client_id` missing (`invalid_request`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: No access to that team, or a connected app targeted another client (`forbidden`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Folder does not exist in the selected scope (`workspace_not_found`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Could not save the binding or resolve the team account
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: The binding could not be read back (`binding_unavailable`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api-keys/{id}/reveal:
post:
tags:
- Account
operationId: revealApiKey
summary: Reveal an API key
description: 'Returns the full key again. Works only for keys created with
`revealable: true`; other keys are shown once, at creation. Allowed for
the key''s owner (or a manager of the owning team) and for people the
key is shared with. The response is never cacheable.
Requires an app session (Supabase JWT), not an API key.'
parameters:
- name: id
in: path
required: true
description: API key id
schema:
type: string
format: uuid
responses:
'200':
description: The plaintext key
headers:
Cache-Control:
schema:
type: string
example: no-store
content:
application/json:
schema:
type: object
required:
- api_key
properties:
api_key:
type: string
example: varg_a1b2c3...
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can manage API keys (API keys and connected applications are rejected)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Unknown API key, or you have no access to it
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: The key was not created revealable
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
notRevealable:
value:
error:
code: api_key_not_revealable
message: This key was shown once, when it was created, and cannot be shown again
/api-keys/{id}/shares:
get:
tags:
- Account
operationId: listApiKeyShares
summary: List who an API key is shared with
description: 'The key''s owner and the people it is shared with. Only the key''s owner
(or a manager of the owning team) can list; people the key is shared
with get 404. Requires an app session (Supabase JWT), not an API key.'
parameters:
- name: id
in: path
required: true
description: API key id
schema:
type: string
format: uuid
responses:
'200':
description: Owner and shares
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyShares'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can manage API keys (API keys and connected applications are rejected)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Unknown API key, or you have no access to it
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post:
tags:
- Account
operationId: shareApiKey
summary: Share an API key
description: 'Shares the key with people by email, so they can reveal and use it. Only
the key''s owner (or a manager of the owning team) can share. Emails
with no varg account are returned in `not_found` and nothing is shared
with them. A key can be shared with at most 50 people. Rate limited
per user. Requires an app session (Supabase JWT), not an API key.'
parameters:
- name: id
in: path
required: true
description: API key id
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyShareRequest'
examples:
share:
value:
emails:
- teammate@example.com
responses:
'200':
description: Updated shares, plus emails that could not be shared
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ApiKeyShares'
- type: object
required:
- not_found
properties:
not_found:
type: array
description: Emails with no varg account
items:
type: string
format: email
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can manage API keys (API keys and connected applications are rejected)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Unknown API key, or you have no access to it
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Invalid body, or the key is already shared with the maximum number of people (`share_limit_reached`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Too many share requests
headers:
Retry-After:
schema:
type: string
X-RateLimit-Remaining:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api-keys/{id}/shares/{userId}:
delete:
tags:
- Account
operationId: unshareApiKey
summary: Remove someone from an API key
description: 'Ends a person''s access to the key. The key''s owner (or a manager of the
owning team) can remove anyone; a person the key is shared with can
remove themselves. Requires an app session (Supabase JWT), not an API key.'
parameters:
- name: id
in: path
required: true
description: API key id
schema:
type: string
format: uuid
- name: userId
in: path
required: true
description: The person to remove (`user_id` from the shares list)
schema:
type: string
format: uuid
responses:
'200':
description: Access removed
content:
application/json:
schema:
type: object
required:
- deleted
properties:
deleted:
type: boolean
example: true
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: Only app sessions can manage API keys (API keys and connected applications are rejected)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Unknown API key, or the key is not shared with that person (`share_not_found`)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
AccountConnectionRequest:
type: object
properties:
client_id:
type: string
description: Required for an app session; a connected app may omit it or must send its own.
team_id:
type:
- string
- 'null'
format: uuid
description: Team to bind to, or null/omitted for the personal account.
workspace_id:
type:
- string
- 'null'
description: Default folder in the selected scope, or null.
ApiKeyShares:
type: object
properties:
owner:
oneOf:
- $ref: '#/components/schemas/ApiKeyPerson'
- type: 'null'
shares:
type: array
items:
$ref: '#/components/schemas/ApiKeyShare'
AccountTeam:
type: object
required:
- id
- slug
- name
- owner
properties:
id:
type: string
format: uuid
slug:
type: string
name:
type: string
owner:
type: boolean
ApiKeyPerson:
type: object
properties:
user_id:
type: string
format: uuid
email:
type:
- string
- 'null'
display_name:
type:
- string
- 'null'
avatar_url:
type:
- string
- 'null'
ApiKeyShare:
allOf:
- $ref: '#/components/schemas/ApiKeyPerson'
- type: object
properties:
shared_at:
type: string
format: date-time
AccountConnection:
type: object
description: Which team and default folder an OAuth connection works in.
required:
- client_id
- team_id
- team_slug
- team_name
- team_owner
- workspace_id
- status
properties:
client_id:
type: string
team_id:
type:
- string
- 'null'
description: Null means the personal account.
team_slug:
type:
- string
- 'null'
team_name:
type:
- string
- 'null'
team_owner:
type: boolean
description: True when the user owns the bound team (owners manage its API keys; members only spend).
workspace_id:
type:
- string
- 'null'
description: Default folder for the connection, if any.
status:
type: string
enum:
- ok
- no_team_access
description: '`ok` means the binding is usable (`team_id: null` is the normal personal case).
`no_team_access` means the user can no longer act in the bound team; clients should refuse to
generate rather than fall back to the personal balance.
'
ErrorResponse:
type: object
properties:
error:
type: object
properties:
code:
type: string
example: model_not_found
message:
type: string
example: 'Unknown model: flux-shnell'
details: {}
ApiKey:
type: object
properties:
id:
type: string
format: uuid
key_preview:
type: string
example: varg_a1b2...c3d4
name:
type: string
type:
type: string
enum:
- personal
- service
description: '`personal` acts for the creating user; `service` is a shared credential with no human behind it'
on_behalf_of_user_id:
type:
- string
- 'null'
format: uuid
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
last_active_at:
type:
- string
- 'null'
format: date-time
revealable:
type: boolean
description: Whether the full key can be shown again (only keys created with `revealable` set to `true`)
role:
type: string
enum:
- owner
- shared
owner:
type:
- object
- 'null'
description: Whose key this is, when `role` is `shared`
properties:
user_id:
type: string
email:
type:
- string
- 'null'
display_name:
type:
- string
- 'null'
avatar_url:
type:
- string
- 'null'
shared_count:
type: integer
required:
- id
- key_preview
- name
- type
- on_behalf_of_user_id
- created_at
- updated_at
- last_active_at
- revealable
- role
- owner
- shared_count
ApiKeyShareRequest:
type: object
required:
- emails
properties:
emails:
type: array
minItems: 1
maxItems: 20
items:
type: string
format: email
maxLength: 254
responses:
Unauthorized:
description: Missing or invalid API key / JWT
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
unauthorized:
value:
error:
code: unauthorized
message: Invalid or missing API key or JWT
ValidationError:
description: Request body failed validation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalid:
value:
error:
code: invalid_request
message: 'Body validation failed (text: Required)'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'varg API key (`varg_...`). Get one at [app.varg.ai](https://app.varg.ai)
or run `bunx vargai login`. App sessions may alternatively send a
Supabase JWT.
'