Models

Model API

One API key for models from different providers, through endpoints compatible with OpenAI, Anthropic, and Gemini, billed by usage.BillingBilled by usage: input, output, cache read, cache write, and reasoning tokens; images are billed per image and videos per second. Enabling the service is free.

curlPythonTypeScriptOpenAI · Anthropic · Gemini compatible
$ curl https://llm.leaflow.cloud/v1/chat/completions \
  -H "Authorization: Bearer $LEAFLOW_API_KEY" \
  -d '{"model": "deepseek-v4.1-flash",
       "messages": [{"role": "user", "content": "Describe Leaflow in one sentence"}]}'

{ "choices": [{ "message": { "content": "Leaflow is cloud infrastructure built for agents and applications." } }],
  "usage": { "prompt_tokens": 18, "completion_tokens": 42 } }

At a glance

WeChat · Shipping

Send me this week’s report from the office computer.

Found it in Documents/Reports. Sent.
  • Find files on office-pcmachine.find
  • Send to WeChatnotify.send
week-45-report.pdf286 KB

Shipping in the Console and in chat apps calls models through the project's model service.

Change the base URL and keep the SDK.

The gateway serves the OpenAI, Anthropic, and Gemini protocols on their own paths. Point the OpenAI SDK at https://llm.leaflow.cloud/v1 and the Anthropic SDK at https://llm.leaflow.cloud. Gemini uses the same origin and its native generateContent path. Requests are forwarded unchanged except for the model name and credentials, and the gateway does not convert between protocols. Send a model only to an endpoint it supports.

OpenAI SDK

  • Base URL https://llm.leaflow.cloud/v1
  • Bearer token in the Authorization header
  • Chat Completions, Responses, and embeddings

Anthropic and Gemini SDKs

  • Base URL https://llm.leaflow.cloud
  • Anthropic accepts x-api-key or Authorization
  • Gemini accepts x-goog-api-key or Authorization

The model catalog lists what each model supports.

The Console's model catalog shows each model's context window, maximum output, input and output types, capabilities, and supported endpoints, with its rates. A request to an endpoint the model does not list is refused before it reaches the upstream. Context and output limits are advisory; the upstream model service enforces the real limit.

Text and embeddings

  • Chat Completions and Responses
  • Anthropic Messages and Gemini generateContent
  • Embeddings

Media

  • Image generation and edits
  • Speech synthesis, transcription, and translation
  • Video generation, with asynchronous tasks

One key per app, limited to the models it needs.

Issue a key in the Console and copy the full secret; it is shown once and cannot be read again. A key can be limited to chosen models, or left open to the whole catalog including models added later. Set an expiry or leave it without one. A disabled key can be enabled again; a revoked key cannot.

Limited to chosen models

  • Only the models on the key's list can be called
  • New models are not added automatically
  • Useful for a service with a fixed set of models

Open to the catalog

  • Every model in the catalog can be called
  • Models added later are included
  • Useful while the model set is still changing

Metadata is recorded. Request and response bodies are not.

Each request records the model, operation, status, HTTP status, streaming or not, retries, timestamps, and usage. The token kinds are recorded separately; media usage is recorded in images, characters and seconds. When the upstream does not report usage, the figures are estimated from the payload and marked as estimated. The request and response bodies are not recorded; quote the upstream request ID when reporting a problem.

Recorded

  • Model and operation
  • Status, HTTP status, retries, and timestamps
  • Token and media usage, with the usage source
  • Key, source, and upstream request ID

Not recorded

  • Request body
  • Response body
  • Prompt and completion text

Usage by model and key. Charges in Billing.

The usage page shows requests, token totals, and media usage for the last 24 hours, 7 days, or 30 days, filtered by model and key. The key detail shows one key's usage over the last 30 days. The service records usage, not amounts. Charges appear in Billing under the project's settlement account, as usage charges and invoices.

Usage in the Console

  • Requests and token totals
  • Media usage by unit
  • Filters by model and key

Charges in Billing

  • Usage charges
  • Invoices and payments
  • Account balance and top-ups

Also included

  • Protocol compatibility

    OpenAI, Anthropic, and Gemini requests reach the same gateway in their own formats.

    https://llm.leaflow.cloud

  • Endpoint types

    Chat Completions, Responses, embeddings, images, speech, transcription, and video, where the model supports them.

    Listed per model

  • Model catalog

    Context window, maximum output, input and output types, capabilities, and endpoints, with rates.

    Filter by provider and capability

  • API keys

    Issue a key per app and copy the secret once.

    Secret shown once

  • Model restrictions

    Limit a key to chosen models, or let it call the whole catalog.

    Chosen models or all

  • Expiry and revocation

    Set an expiry, disable a key temporarily, or revoke it for good.

    Disabled keys can return

  • Request records

    Model, operation, status, retries, timestamps, token and media usage, and the upstream request ID.

    Bodies are not recorded

  • Usage reports

    Requests, tokens, and media, filtered by model and key.

    24 hours, 7 days, or 30 days

  • Per-key usage

    See what one key called and how much it used.

    Last 30 days

  • Token and media rates

    Each token kind, each image, and each video second is priced at its own rate.

    Rates in the account currency

  • Streaming

    Stream in each protocol's own event format, or ask for one JSON response.

    SSE or JSON

  • Stored responses

    The Responses API can store a response and continue it within the project and the original provider credential.

    Storage is off by default

Estimate model costs

DeepSeek V4.1 FlashDeepSeek

Supports text and image understanding, a one-million-token context, reasoning, and tool calling.

Cache and reasoning usage
Model details
Model ID
deepseek-v4.1-flash
Inputs
Text · Images
Outputs
Text
Context window
1,000,000 Token
Max output
384,000 Token
Tool calling
Supported
Structured output
Supported
Reasoning
Supported
API endpoints
/v1/chat/completions

8 available modelsUSD · Pay as you go

Billing details

Text models: sum each token category at its listed rate. Input excludes cache reads; output excludes separately reported reasoning tokens. Images are billed per image and videos per generated second at the selected resolution. A dash means no published rate, not free usage.

Details

Endpoint
https://llm.leaflow.cloud
OpenAI base URL
https://llm.leaflow.cloud/v1
APIs
OpenAI, Anthropic, and Gemini
Authentication
API key
Key limits
Chosen models, optional expiry, disable or revoke
Billing
Input, output, cache read, cache write, and reasoning tokens; images per image and videos per second
Enablement
One service per project; enabling is free and needs a settlement account
Usage windows
24 hours, 7 days, and 30 days in the Console
Request records
Metadata only; request and response bodies are not recorded
Usage source
Upstream report, or estimated to within roughly 15 percent
Same service
Shipping and Fleet's automatic sudo review

Questions

Can I use the OpenAI, Anthropic, or Gemini SDK I already have?

Yes. Change the base URL and use an API key. The gateway keeps each protocol's request and response format; it does not convert one protocol into another.

Which models are available?

The Console's model catalog lists the models currently offered, with context, output, capabilities, and prices. The catalog changes, so check it before you choose a model ID.

Can I limit a key to certain models?

Yes. A restricted key can call only the models on its list. An unrestricted key can call the whole catalog, including models added later. Both can have an expiry.

How much did a request cost?

The usage page shows requests, tokens, and media, not amounts. Charges appear in Billing under the project's settlement account, as usage charges and invoices.

Are prompts and responses stored?

No. Request and response bodies are not recorded. The record keeps metadata such as the model, status, retries, timestamps, and usage; quote the upstream request ID when reporting a problem.

How accurate is the usage figure?

It comes from the upstream when the provider reports it. When it does not, the gateway estimates it from the payload, to within roughly 15 percent, and marks the record as estimated.

Does it work with streaming?

Yes. Each protocol streams in its own event format, and a request can ask for one JSON response instead.

How is it billed?

By usage. Input, output, cache read, cache write, and reasoning tokens are priced separately; images are billed per image and videos per second. Enabling the service is free. A top-up of at least US$1 is needed before you start using Leaflow.

Get started in the Console.

Top up at least US$1 before first use. After that, each product is billed at its public price.