legivel Usage API
The Usage API from legivel — 1 operation(s) for usage.
The Usage API from legivel — 1 operation(s) for usage.
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/legivel-com:legivel-com-usage-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: Legivel Usage API
version: 1.0.0
summary: Turn Markdown into a PDF over HTTP.
description: A render endpoint, templates made from Markdown, HTML or an editor document and rendered from JSON or CSV data, a usage endpoint and a health probe. Every call but the health probe and this document carries an API key. Sizes, page counts and rates follow the account's plan; a refusal names the limit it hit.
servers:
- url: https://api.legivel.com
description: Production
security:
- bearer: []
tags:
- name: Usage
paths:
/v1/usage:
get:
operationId: getUsage
summary: Read the account's usage
description: The documents used and the limits in force for one usage period. Reading usage costs nothing and is not counted against the burst limit.
parameters:
- name: period
in: query
required: false
description: A usage period id of this account. Omit it for the period that is open now. A well-formed id that is not this account's answers 404, the same as an unknown one.
schema:
type: string
pattern: ^[1-9]\d{0,18}$
description: A decimal id, carried as a string because it does not fit a JSON number.
responses:
'200':
description: The usage report.
content:
application/json:
schema:
$ref: '#/components/schemas/UsageReport'
'400':
description: '- `invalid_request`: A field of the request was missing, of the wrong type or out of range.'
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
invalid_request:
summary: invalid_request
value:
code: invalid_request
error: A field of the request was missing, of the wrong type or out of range.
reason: render_options
'401':
description: '- `unauthorized`: The request carried no API key, or one that is no longer valid.'
headers:
WWW-Authenticate:
description: 'The challenge for a missing or invalid key: `Bearer`.'
required: true
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
unauthorized:
summary: unauthorized
value:
code: unauthorized
error: 'The API key is missing or not valid. Send it as "Authorization: Bearer <key>".'
'404':
description: '- `not_found`: The usage period asked for does not belong to this account, or the path does not exist.'
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
not_found:
summary: not_found
value:
code: not_found
error: The usage period asked for does not belong to this account, or the path does not exist.
'405':
description: '- `method_not_allowed`: The path exists but does not answer this HTTP method; the Allow header lists the ones it does.'
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
method_not_allowed:
summary: method_not_allowed
value:
code: method_not_allowed
error: The path exists but does not answer this HTTP method; the Allow header lists the ones it does.
'429':
description: '- `rate_limited`: The account sent more requests, or asked for more concurrent renders, than its plan allows, or one client address presented more API keys for checking than the service accepts at once.'
headers:
Retry-After:
description: Seconds to wait before sending the request again. Present on the refusals that name a wait.
required: false
schema:
type: integer
minimum: 0
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
rate_limited:
summary: rate_limited
value:
code: rate_limited
error: The account sent more requests, or asked for more concurrent renders, than its plan allows, or one client address presented more API keys for checking than the service accepts at once.
limit:
name: key_verifications
value: 10
plan: null
'500':
description: '- `internal_error`: The request failed for a reason the service could not classify.'
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
internal_error:
summary: internal_error
value:
code: internal_error
error: The request failed for a reason the service could not classify.
tags:
- Usage
components:
schemas:
StandardsWarning:
type: object
title: StandardsWarning
description: One thing the converter did about a PDF standard, or why it left one out. The documentation lists each code with its fix.
properties:
code:
type: string
pattern: ^[a-z_]{1,64}$
description: The stable name of the warning, as `X-Legivel-Warnings` lists it.
message:
type: string
description: One sentence of English that may be reworded at any time.
detail:
type: object
properties:
count:
type: integer
minimum: 0
description: How often the warning applied in the document.
required:
- count
additionalProperties: false
description: What the converter counted, where it counts.
required:
- code
- message
additionalProperties: false
ErrorEnvelope:
type: object
title: ErrorEnvelope
description: 'Every refusal has this shape. `code` is the stable machine name to switch on; `error` is one sentence of English that may be reworded at any time. The optional fields appear only where the code can carry them. A 413 raised by the converter''s own bounds carries `reason: "preparation_limit"` and no `limit`: the bound is not a number the plan sells, so there is nothing to report against the account''s allowance.'
properties:
code:
type: string
enum:
- unauthorized
- account_blocked
- email_unverified
- identity_limit
- certificate_name_taken
- browser_only
- invalid_request
- payload_too_large
- empty_document
- too_many_pages
- too_many_resources
- resource_fetch_failed
- resource_invalid
- idempotency_in_progress
- idempotency_mismatch
- idempotency_replay_limit
- rate_limited
- quota_exhausted
- quota_unavailable
- queue_full
- render_timeout
- render_unavailable
- render_failed
- plan_required
- sign_not_available
- invalid_bundle
- certificate_expired
- signing_failed
- signing_unavailable
- unknown_signing_identity
- not_found
- method_not_allowed
- upload_failed
- template_invalid
- template_data_invalid
- template_name_taken
- template_limit_reached
- template_version_conflict
- templates_unavailable
- language_missing
- title_missing
- mathml_required
- glyph_missing
- unicode_invalid
- private_use_text
- engine_unsupported
- plan_raster
- internal_error
description: The stable name of the refusal.
error:
type: string
description: One sentence describing the refusal, for a log or a message to the account.
limit:
$ref: '#/components/schemas/Limit'
reason:
type: string
description: A narrower machine name for the cause, where the code alone does not say it.
resource_id:
type: string
description: 'The opaque id of the resource that failed, as the resources-failed headers list it: `r<n>` for a fetched source, `e<n>` for the n-th resource the document draws, counted from 1.'
line:
type: integer
minimum: 1
description: 'On `resource_invalid`: the Markdown line of the resource that could not be read, counted from 1, when it is known.'
renderer_bound:
type: string
description: The converter bound a 413 hit, when the refusal names one instead of a plan limit.
table:
type: object
description: 'On `preparation_limit`: the large table that fills most of the document, when the converter names one.'
properties:
number:
type: integer
minimum: 1
description: The table's place among the document's tables, counted from 1.
columns:
type: integer
minimum: 1
description: Its number of columns.
rows:
type: integer
minimum: 0
description: Its number of body rows.
required:
- number
- columns
- rows
additionalProperties: false
status:
type:
- integer
- 'null'
description: 'On `upload_failed`: the HTTP status the storage answered the PUT with, or null when no answer arrived.'
issues:
type: array
description: 'On `template_data_invalid`: every place the data did not fill the template.'
items:
type: object
properties:
path:
type: string
description: The data path (`customer.name`), the CSV source (`csv:items`) or a row cell (`csv:items[3].qty`).
message:
type: string
description: What is wrong there, in one sentence.
required:
- path
- message
additionalProperties: false
warnings:
type: array
items:
$ref: '#/components/schemas/StandardsWarning'
description: 'On a strict standards refusal: every warning of the render, the refusal''s code first among the codes that leave a standard out.'
required:
- code
- error
additionalProperties: false
UsageReport:
type: object
title: UsageReport
description: The account's documents and limits for one usage period.
properties:
plan:
type: string
description: The id of the plan the period is counted against.
period_start:
type: string
format: date-time
description: When the period opened.
period_end:
type: string
format: date-time
description: When the period closes.
credits_included:
type: integer
description: Documents the plan includes in the period.
credits_granted:
type: integer
description: Documents granted on top of the plan's, such as carry-over on an upgrade.
credits_used:
type: integer
description: Documents used in the period, editor downloads included; this is the number a 402 reads.
limits:
type: object
title: UsageLimits
description: The limits in force for the account in this period, from its plan.
properties:
markdown_kb:
type: integer
description: Largest Markdown document, in kibibytes.
resources_mb:
type: number
description: Total resource bytes one render may load, in mebibytes.
pages_max:
type: integer
description: Most pages one rendered document may have.
timeout_s:
type: integer
description: Longest one render may run, in seconds.
concurrency:
type: integer
description: Renders the account may have in flight at once.
requests_per_min:
type: integer
description: Requests a minute before the burst limiter refuses.
previews_per_hour:
type: integer
description: Editor previews an hour; the API never spends these.
required:
- markdown_kb
- resources_mb
- pages_max
- timeout_s
- concurrency
- requests_per_min
- previews_per_hour
additionalProperties: false
keys:
type: array
items:
$ref: '#/components/schemas/KeyUsage'
description: The period's spending split by API key. The editor's share is `credits_used` less the sum of these, so the two need not add up.
required:
- plan
- period_start
- period_end
- credits_included
- credits_granted
- credits_used
- limits
- keys
additionalProperties: false
Limit:
type: object
title: Limit
description: 'The limit a refusal hit, in the plans table''s own names, so a client can show the number it was measured against. `plan` is the plan the number came from, `raster` for the free watermarked delivery, or null when the number is not the plan''s: a service-wide limit no plan sells, or a deployment ceiling that lowered the plan''s own number.'
properties:
name:
type: string
enum:
- markdown_kb
- resources_mb
- pages_max
- timeout_s
- concurrency
- requests_per_min
- resource_count
- key_verifications
description: 'Which limit: the plans table''s column name.'
value:
type: number
description: The number that was exceeded, in the unit the name implies.
plan:
type:
- string
- 'null'
description: The plan the number came from, `raster` for the watermarked delivery, or null when the number is the service's rather than a plan's (a limit no plan sells, or a deployment ceiling below the plan's own number).
required:
- name
- value
- plan
additionalProperties: false
KeyUsage:
type: object
title: KeyUsage
description: One API key's share of the period.
properties:
id:
type: string
description: The API key's id.
name:
type:
- string
- 'null'
description: The key's current name; null once the key is gone.
credits:
type: integer
minimum: 0
description: Documents charged through this key, returned documents excluded.
required:
- id
- name
- credits
additionalProperties: false
securitySchemes:
bearer:
type: http
scheme: bearer
description: 'An API key from the dashboard, sent as `Authorization: Bearer <key>`. Keys begin with `lgvl_` and carry the account''s plan and quota.'
x-legivel-plan-limits:
- id: free
name: Free
limits:
markdown_kb: 512
resources_mb: 1.5
pages_max: 20
timeout_s: 30
concurrency: 1
requests_per_min: 5
resource_count: 50
key_verifications: 10
credits_per_period: 100
max_replays: 2
previews_per_hour: 120
- id: starter
name: Starter
limits:
markdown_kb: 2048
resources_mb: 6
pages_max: 200
timeout_s: 60
concurrency: 2
requests_per_min: 30
resource_count: 50
key_verifications: 10
credits_per_period: 1000
max_replays: 5
previews_per_hour: 600
- id: pro
name: Pro
limits:
markdown_kb: 4096
resources_mb: 12
pages_max: 1000
timeout_s: 90
concurrency: 5
requests_per_min: 120
resource_count: 50
key_verifications: 10
credits_per_period: 10000
max_replays: 5
previews_per_hour: 600
- id: scale
name: Scale
limits:
markdown_kb: 8192
resources_mb: 24
pages_max: 2048
timeout_s: 120
concurrency: 20
requests_per_min: 600
resource_count: 50
key_verifications: 10
credits_per_period: 100000
max_replays: 5
previews_per_hour: 600