API Documentation

OpenAI-compatible inference with one API key.

Download .md

Point any OpenAI-compatible client at https://logfare.ai/v1 and use your Logfare API key. Anthropic Messages and the OpenAI Responses API also work. Model IDs change often, so check /models for what's available right now.

Authentication

Model requests need an API key. Register for a free account: your first key is shown when you sign up. Create more keys in your dashboard (up to 10, one per app or machine is a good habit) and revoke or roll each one on its own. Keys share your account's model access, limits and privacy choices. Logfare keeps only a fingerprint of each key, so a key is shown once, when it's created or rolled. Your Discord account must stay in the Logfare server to keep access.

Send the key as a Bearer token. The x-api-key header also works, which is what Anthropic clients send.

Header
Authorization: Bearer YOUR_API_KEY

Building an app for other people? Use App integrations so each user approves your app without sharing their key.

Endpoints

All endpoints are under https://logfare.ai/v1.

MethodEndpointDescription
POST/v1/chat/completionsChat completions (streaming supported)
POST/v1/responsesOpenAI Responses API
POST/v1/messagesAnthropic Messages API
POST/v1/completionsLegacy text completions
POST/v1/images/generationsImage generation
POST/v1/images/editsImage editing
POST/v1/audio/speechText to speech
POST/v1/audio/transcriptionsSpeech to text
POST/v1/embeddingsText embeddings
POST/v1/videos/generationsVideo generation
POST/v1/decisionsDecision models
GET/v1/modelsAvailable models (no key needed)
GET/v1/statusService and model health (no key needed)

Models & access

GET /v1/models

Lists the models available on Logfare, in the OpenAI format. No key is needed; with a key, the list also includes private models your key can reach. Chat-only models are listed for discovery but cannot be used with an API key. Each entry adds these Logfare fields:

FieldDescription
endpointsAPIs the model serves, such as chat/completions or images/generations
aliasesOther names that route to the same model
tier, access_tierAccess tier: 1/standard, 2/premium or 3/pro (see below). Private models report tier: 0; their access_tier still names the gate.
requires_training_optintrue for premium and pro models
requires_data_sale_optintrue for pro models
chat_onlytrue when the model is available only in Logfare Chat. It is listed for discovery, but every API key, OAuth app and SSO request returns 403 with code chat_only_model.
premium_unlockedWhether the key you sent can use the model right now (any tier)
rate_limit_exemptWhether the model bypasses account and network request allowances. Account and service concurrency limits still apply.
chat_capabilitiesInput types (input_modalities), reasoning controls, and tools support for chat models
context_length, max_output_tokensInput and output limits Logfare enforces for the model, when set. Larger inputs are rejected with 413; larger max_tokens values are lowered.
upstream_metadataPublished specs such as context length, input types and supported parameters, when available. For text models, top_provider.max_completion_tokens is the output ceiling the model's primary upstream provider advertises; it varies by provider and shares the context window with your input. These are a general reference, so check the limits above first.

There are three tiers, and every one is free:

TierUnlocked byRate-limit perk
StandardAn account—
PremiumOpting in to model training at /consentPremium account budget (see Request limits)
ProOpting in to model training and data sale at /consentPro account budget (see Request limits)

The models page labels Standard models Free. Its search matches model names, aliases, tier labels such as Free or Pro, API endpoints, owners, and published model details. Models that bypass request allowances carry a Request-limit exempt label.

Until you reach a model's tier, requests return 403 with code training_optin_required (premium) or data_sale_optin_required (pro). Account tier budgets and concurrency are configurable independently. Your allowance is shared across all unlocked models, API formats and connected apps; it is not a separate allowance per model.

Discord boost bonuses use the percentage configured by staff. The current request percentage and extra concurrent requests per boost are listed under Request limits. Concurrency bonuses add a fixed whole number per boost, independently of the request percentage; 0 adds none. Any custom request or concurrency override disables all boost bonuses for that account, and new accounts do not receive boost bonuses. Discord exposes boosting status, not the exact count; ask staff to verify additional boosts. See Dashboard → Overview for your effective numbers.

Training consent, data-sale consent, optional history inclusion and evaluation preferences can be managed at Dashboard → Privacy & Data or /consent. Data-sale opt-in is only available after the displayed opening date and requires training consent. Withdrawing training consent also withdraws data-sale consent. Global Privacy Control is honoured; opting in despite that signal requires confirmation.

curl
curl https://logfare.ai/v1/models

Chat Completions

POST /v1/chat/completions

Standard OpenAI chat completions. Set "stream": true to stream over SSE.

ParameterTypeRequiredDescription
modelstringYesModel ID from /models, or logfare/auto
messagesarrayYesArray of {role, content} messages
streambooleanNoStream the response over SSE
max_tokensintegerNoMaximum tokens to generate
temperature, top_p, stopNoStandard sampling options

Other OpenAI parameters, such as tools, response_format, reasoning_effort, and image content parts, are passed to the model's provider. Check the model's chat_capabilities to see what it supports.

curl
curl https://logfare.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "logfare/auto",
  "messages": [
    {"role": "user", "content": "Hello!"}
  ]
}'
Python (streaming)
from openai import OpenAI

client = OpenAI(
    base_url="https://logfare.ai/v1",
    api_key="YOUR_API_KEY",
)

stream = client.chat.completions.create(
    model="logfare/auto",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)

for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Auto Routing

Use logfare/auto as the model and Logfare picks the best available chat model for you. If a model fails, the next one in the chain is tried, so you still get a response. auto and logfare/random are aliases.

Routing only uses models your key can access. Private models and Logfare Chat-only models are never in the Auto chain. Auto works with Chat Completions, Messages, and Responses.

Messages & Responses

POST /v1/messages   POST /v1/responses   POST /v1/completions

Use the Anthropic Messages format, the OpenAI Responses format, or legacy completions with the same models and key. Point an Anthropic SDK's base URL at https://logfare.ai (without /v1).

Anthropic Messages
curl https://logfare.ai/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
  "model": "logfare/auto",
  "max_tokens": 1024,
  "messages": [
    {"role": "user", "content": "Hello!"}
  ]
}'

Images

POST /v1/images/generations

ParameterTypeRequiredDescription
modelstringYesImage model ID
promptstringYesDescription of the image
sizestringNoDimensions as WxH, such as 1024x768
n, steps, response_formatNoSupported by some models

POST /v1/images/edits takes the same fields as multipart/form-data, plus the source image. Only models listing images/edits support it.

curl
curl https://logfare.ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "flux-2-dev",
  "prompt": "a cat sitting on a windowsill, warm afternoon light",
  "size": "1024x1024"
}'

Text to Speech

POST /v1/audio/speech

Send model and the input text as JSON; voice is optional and depends on the model. Returns audio.

Transcriptions

POST /v1/audio/transcriptions

Send model and the audio file as multipart/form-data. Returns the transcribed text.

Embeddings

POST /v1/embeddings

Send model and input, a string or an array of strings. Returns one vector per input.

Video

POST /v1/videos/generations

Send model and prompt as JSON. The request stays open until the video is ready, which can take several minutes, so set a long client timeout. Other fields depend on the model.

Decision Models

POST /v1/decisions

A decision model reads a state and a set of typed questions, and returns a probability for every allowed answer instead of generating text. Use it to classify, route, or score. Models: clef (27B, most precise), clef-flash (9B, faster), and 8ball, a joke model that answers by hashing the state (deterministic and not logged). Questions about self-harm always get a supportive no, marked "support": true.

ParameterTypeRequiredDescription
modelstringYesclef, clef-flash, or 8ball
statestring | objectYesWhat to decide on: text, JSON, or an image or video reference
questionsobjectNoMap of question name to {type, instructions, criteria}. Omit it for a single yes/no answer about the whole state.

Question types: noul returns a yes/no probability. choice takes a map of options to descriptions and returns the chosen option with per-option probabilities. score takes an ordered list of levels and returns a weighted score with per-level probabilities.

curl
curl https://logfare.ai/v1/decisions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "clef",
  "state": "Checkout has been failing for every customer for the last hour.",
  "questions": {
    "urgent": { "type": "noul", "instructions": "Is this support request urgent?" },
    "team": {
      "type": "choice",
      "instructions": "Which team should handle this request?",
      "criteria": {
        "billing": "Payments, invoices, and refunds",
        "technical": "Outages, errors, and configuration",
        "sales": "Plans and upgrades"
      }
    },
    "severity": {
      "type": "score",
      "instructions": "How severe is the customer impact?",
      "criteria": ["No impact", "Minor", "Major", "Critical"]
    }
  }
}'

Response (answers is keyed by question name):

{
  "result": {
    "model": "clef",
    "answers": {
      "urgent": { "type": "noul", "noul": 0.9895 },
      "team": {
        "type": "choice",
        "choice": "technical",
        "probabilities": { "billing": 0.1584, "technical": 0.8274, "sales": 0.0142 },
        "confidence": 0.5648
      },
      "severity": {
        "type": "score",
        "score": 2.9484,
        "legend": { "0": "No impact", "1": "Minor", "2": "Major", "3": "Critical" },
        "probabilities": { "0": 0.0043, "1": 0.0047, "2": 0.0292, "3": 0.9618 },
        "confidence": 0.9012
      }
    }
  },
  "success": true,
  "errors": [],
  "messages": []
}

Request limits

These are the current limits and update automatically when they change.

ScopeRequest budgetConcurrent requests
Regular account40 requests per minute
1,000 requests per hour
5,000 requests per day
6
Premium account80 requests per minute
2,000 requests per hour
10,000 requests per day
12
Pro account160 requests per minute
4,000 requests per hour
20,000 requests per day
24
New account10 requests per minute
200 requests per hour
500 requests per day
2
Shared network / IP320 requests per minute
8,000 requests per hour
40,000 requests per day
Account and service limits apply

Each account tier has one shared allowance across its unlocked models. Discord boosts add +50% per boost to the request allowance (up to 4 counted boosts). Each boost also adds 12 concurrent requests, independently of the request percentage. Any custom request or concurrency override disables all boost bonuses for that account. New accounts do not receive boost bonuses. See your effective limits in Dashboard → Overview.

New accounts use the new-account budget for their first 24 hours.

Up to 800 requests can be in progress across all accounts. Individual models and providers can have their own shared limits, so capacity isn't guaranteed.

During the new-account period, opting in can unlock Premium or Pro models, but the temporary new-account request and concurrency limits still apply. The tier's account limits take effect once probation ends, unless an admin has set custom limits. Your training and data-sale choices apply immediately to requests made during probation, including eligibility for training or sale when you opt in. Routine request logging continues when you opt out of these uses.

The dashboard labels the active limit schedule NEW, STANDARD, PREMIUM, PRO, or CUSTOM. A model marked Request-limit exempt bypasses account and network request allowances, while concurrency limits and provider caps still apply.

The shared network allowance is counted across every account that reaches Logfare from the same address, and it applies in addition to your account's own limits. The lower one stops a request. This is checked per window. In any window (minute, hour or day) where your account's own limit is higher than the network's, or unlimited, your account's limit applies instead, and your requests don't use up the network's count for that window. Every other window, and every other account on the address, is counted as usual.

Dashboard → Overview shows how much of each limit you've used in the current window and when it resets. Each admitted inference request also returns x-ratelimit-limit-requests, x-ratelimit-remaining-requests and x-ratelimit-reset-requests (for example 35s) for the account window closest to running out; models exempt from request limits don't send them. Limits apply across all endpoints and use fixed UTC windows; provider daily budgets reset at 00:00 UTC. Regenerating your key doesn't reset them. When your account or network reaches a request allowance, the 429 error names each blocking window and its effective request limit. The error.limits array gives requests and window_seconds; error.retry_after matches the Retry-After header. Wait that long before retrying. Upstream provider errors may include different details.

Fair use: one account, back off when refused

  • One account per person. Extra accounts (including ones linked to other Discord accounts) and using someone else's account aren't allowed, and neither is rotating accounts, keys, Discord accounts, IP addresses or networks to get past limits or a suspension. Accounts we believe belong to the same person may all be suspended. Apps where other people connect their *own* accounts are fine. See the Terms.
  • Automation is welcome within your limits. Scripts, bots, agents and apps can use Logfare as much as your limits allow.
  • You can just queue. A request sent while your account is at its concurrency limit waits for a free slot (up to 30 seconds by default) and starts as soon as one frees up, so there's no need to cap each agent yourself. Only if no slot frees up in time do you get a 429.
  • Back off when refused. After a 429 or 503, wait at least the Retry-After time before retrying, and don't retry in a tight loop. A key that keeps retrying straight through refusals is paused automatically: every request gets an immediate 429 with a Retry-After until the pause ends (30 seconds by default). Clients that respect Retry-After are never paused. Need more? Ask staff instead of working around the limits.

Errors

Errors use the OpenAI format. /v1/messages and /v1/responses use the Anthropic and Responses formats instead.

Error response
{
  "error": {
    "message": "Your account has reached its request budget. Limit reached: 40 requests per minute. Retry in 23 seconds.",
    "type": "rate_limit_error",
    "limits": [{"requests": 40, "window_seconds": 60}],
    "retry_after": 23
  }
}
StatusMeaning
400Invalid request. Code content_policy_violation means content moderation blocked it.
401Missing or invalid API key
403No access: Discord membership or screening needed, a private model, a Logfare Chat-only model (code chat_only_model), a premium model that needs training opt-in (code training_optin_required), or a pro model that needs data-sale opt-in (code data_sale_optin_required)
404Unknown model, or the model doesn't support this endpoint
413Request body too large, or input over the model's context limit (code context_length_exceeded)
429Request limit reached. Respect Retry-After.
5xxThe provider failed or the service is busy. Retry with backoff or try another model.

Errors returned by a model's provider are passed through with the provider's status code and message.

Account API

These endpoints power the Logfare website and use its login session, not your API key. Create an account on the registration page. Existing accounts without Discord can link it at /migrate. Each Discord account links to one Logfare account, and leaving the server suspends access until you rejoin.

MethodEndpointDescription
GET/v1/auth/meCurrent account, consent flags and effective limits (tier, request windows, concurrency, boost adjustments, and usage: requests used in each current window, seconds until it resets, and requests running now)
GET/v1/auth/api-keysYour API keys: name, prefix, created and last-used times. Never the keys themselves.
POST/v1/auth/api-keysCreate a key ({"name": "Laptop"}). The response's api_key is the only time it's shown.
POST/v1/auth/api-keys/{id}/rollReplace a key with a new one of the same name; the old one stops working at once
DELETE/v1/auth/api-keys/{id}Revoke a key
POST/v1/auth/regenerate-keyReplace your Default (oldest) key
POST/v1/auth/training-preferenceOpt in to or out of model training ({"training_opt_in": true}), which unlocks premium models. Opting out also opts you out of data sale.
POST/v1/auth/data-sale-preferenceOpt in to or out of data sale ({"data_sale_opt_in": true}), which unlocks pro models. Requires training opt-in first (409 otherwise).
POST/v1/auth/eval-preferenceOpt out of evaluation datasets ({"eval_dataset_opt_out": true})
POST/v1/auth/discord/membership/checkRefresh access after rejoining the Discord server
POST/v1/me/leaderboardJoin or leave the public leaderboard ({"listed": true}). Joining shows your username and token totals; leaving hides them right away.
POST/v1/me/deleteDelete your account after a 30-day recovery period

Leaderboard

GET /v1/leaderboard?period=7d returns the public leaderboard and needs no key. period is 24h, 7d (default), 30d or all. sort picks the ranking: total_tokens (default), input_tokens, output_tokens, requests or estimated_value_usd; ties go to more total tokens, then more requests. Only accounts that joined are listed, by username, ranked from successful requests made with any of their keys or connected apps, Chat included. total_tokens is input + output. entries holds the top 100 by the chosen sort with rank, username, requests, input_tokens, output_tokens, reasoning_tokens, cached_tokens, total_tokens and estimated_value_usd (listed model prices; nobody is charged). ranked counts everyone ranked and combined totals them. With a login session, you gives your own numbers, your rank if you're listed, or would_rank (where you'd land) if you're not, for 24h and 7d only (would_rank_available); only you see it. Right after joining, you.pending is true while your history is counted, usually a few minutes, and you aren't ranked yet. Totals refresh every couple of minutes (refresh_seconds); generated_at is when.

App integrations

Users can grant an app specific access without sharing their password, browser session, or main API key. They can revoke its separate credential at any time.

Register your application

In Developer Apps, create an app and choose its permissions. Its public lfa_… app ID identifies the registration. Each account can have five apps; deleting one frees a slot.

Who can connect? Choose Anyone or Only you. Only you restricts approval to the creator's Logfare account. Switching to it revokes other users' connections; switching back permits new approvals without restoring revoked tokens.

App authentication defaults to App ID only, for distributed apps and plugins. Anyone knowing the ID can start a request, but account access still requires user approval. For backends or private automation, choose Require app secret: requests must also authenticate with the generated secret. Copy it when shown; Logfare stores only its hash. Keep it out of distributed apps, where it could be extracted.

Changing authentication or resetting a secret cancels unfinished connection attempts. Existing approved connections stay active. An app ID alone does not prove which executable is running; confirm that you started the connection in an app you trust.

Select permissions

Each connection can request a subset of the permissions you register. Users see and approve those exact permissions. Scopes are read-only for account data; none can change privacy choices, API keys, or account settings.

Chat and codinginference:chat

Send text-model requests and receive responses, including streaming and tool calls.

Imagesinference:images

Generate and edit images using your account's available models.

Audioinference:audio

Generate speech and transcribe audio using your account's available models.

Videoinference:video

Generate videos using your account's available models.

Embeddingsinference:embeddings

Create embeddings using your account's available models.

Read account usageusage:read

View aggregate account-wide usage: totals, time charts, and breakdowns by model and API/app connection. No prompts, responses, or individual request history.

Read request limitslimits:read

View your account's request limits and concurrency, how much of each is used right now, and when each resets. No prompts, responses, or request history.

Read privacy preferencesconsent:read

View training and evaluation preferences, including when each was last changed. Cannot change either preference.

Read basic account infoaccount:read

View your Logfare user ID, username, and account creation date. No API key or account changes.

Read Discord account and server statusdiscord:read

View your linked Discord user ID, whether you are in the Logfare server, and when you joined. This status remains readable after leaving the server while your Logfare account is active. No Discord token, role list, or Discord account access.

inference:chat covers chat, completions, Anthropic Messages, and Responses. Images covers generation and edits; audio covers speech and transcription. Scopes do not bypass account access, training requirements, or shared limits. /v1/models is public.

Connect an account

Secret-required apps authenticate both requests below using HTTP Basic auth: the app ID as username and app secret as password. Form-encoded client_secret with client_id is also supported; use one authentication method. Never put a secret in a URL. App ID only clients omit the secret.

  1. Request a device code with your app ID and registered scopes.
  2. Show the user code and open verification_uri_complete; also offer the manual verification_uri. The user signs in, verifies Discord if prompted, then approves or denies.
  3. Poll at the returned interval using the temporary device_code.
  4. Store the access token in the host's secure credential manager and send it as a Bearer token.
Start a connection
POST https://logfare.ai/v1/integrations/oauth/device_authorization
Content-Type: application/x-www-form-urlencoded

client_id=lfa_YOUR_APP_ID&scope=inference%3Achat%20consent%3Aread

This requests chat and read-only privacy preferences; register both first. If omitted, scope defaults to registered inference:chat. Unknown or unregistered scopes return invalid_scope.

The response includes device_code, user_code, verification_uri, verification_uri_complete, expires_in=900 (15 minutes), and interval=5 (seconds).

Check approval
POST https://logfare.ai/v1/integrations/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=urn:ietf:params:oauth:grant-type:device_code&client_id=lfa_YOUR_APP_ID&device_code=DEVICE_CODE

Success returns a Bearer access token, granted scopes, and a 180-day expiry. Device codes are single-use; there is no refresh token, so reconnect after expiry or revocation.

Waiting, errors, and recovery

  • authorization_pending: keep polling; slow_down: add at least five seconds to the interval.
  • For HTTP 429, honor Retry-After. Back off on network errors or HTTP 503, and let the user cancel.
  • access_denied: stop. For expired_token or invalid_grant, offer a new connection.
  • invalid_client: check the app ID, status, and required secret. For invalid_scope, check registered permissions. On API 401, clear the stale token; on insufficient_scope, request new approval.

Read approved account information

GET endpointRequired scopeResponse
/v1/me/usage?hours=168usage:readAccount-wide totals, zero-filled time buckets, model and connection breakdowns, last API use, and generation time. Connections are api (direct API key use), chat (Logfare Chat) and integration:<id> for each connected app. Windows: 24, 168 (default), 720, 2160 (90 days), 8760 (365 days), or 0 (all available history). Reports the earliest retained account request and uses weekly/monthly buckets for longer ranges. Every total also carries cached_tokens (the cache-read part of prompt_tokens), reasoning_tokens (part of completion_tokens) and estimated_value_usd (usage priced at listed model rates; not a charge). streak gives current_days (consecutive UTC days with a successful request, ending today or yesterday) and active_today. Cached for 60 seconds after checking access.
/v1/me/limitslimits:readThe account's effective limits: tier, source (standard, probation or custom), request windows (requests and seconds; 0 is unlimited), concurrency, boost details, and usage: for each window used and resets_in (seconds), plus in_flight requests. usage is null when it can't be read. Shared network limits are not included.
/v1/me/consentconsent:readtraining_opt_in, data_sale_opt_in, eval_dataset_opt_out, and their respective training_pref_updated_at, data_sale_pref_updated_at and eval_pref_updated_at timestamps (null if never changed).
/v1/me/profileaccount:readuser_id, username, and UTC created_at.
/v1/me/discorddiscord:readdiscord_user_id as a string or null, discord_is_member, and discord_joined_at (null if unlinked or unavailable). No Discord access token or role list.
Read privacy preferences
GET https://logfare.ai/v1/me/consent
Authorization: Bearer <access_token>

{"training_opt_in": false, "data_sale_opt_in": false, "eval_dataset_opt_out": false}

For model selection, hide models marked requires_training_optin=true when training_opt_in=false, and models marked requires_data_sale_optin=true unless both training_opt_in and data_sale_opt_in are true (or just use premium_unlocked from /v1/models). Evaluation preference is independent and does not unlock models. Logfare still checks current access on every inference request.

The account owner's browser session also works, but a Bearer token needs its own scope. These read-only endpoints are not a Sign in with Logfare service: browser callbacks and identity tokens are not provided. Deactivation revokes connections. Leaving the Logfare Discord server blocks inference and account reads until access is restored; discord:read can still report membership for an active account.

Permissions and connection lifecycle

Changing an app's permissions never silently expands existing credentials. Removing a scope removes it from credentials and invalidates pending requests that need it. Users can revoke connections individually; disabling or deleting an app revokes all of them. Revoked credentials stay revoked, while usage attribution is retained.

Developers see connection totals, not users' credentials, prompts, responses, or request history. Account data requires a user's approved token with the matching scope.

Connect and make a test request

Run your integration's normal setup or connect command, approve the requested permissions in Logfare, then select a Logfare model in the integration. For an OpenAI-compatible client, use this configuration:

Logfare connection settings
Base URL: https://logfare.ai/v1
API credential: the access token returned after approval
Model: logfare/auto

Keep /v1 exactly once in the base URL. Test with a short chat request, then review the connection and usage in your dashboard. Revoke test connections you no longer need.

Use HTTPS outside loopback development. Never log device codes or access tokens or put them in URLs. The protocol follows the OAuth device authorization grant.

Help & community

For questions, bug reports, feature ideas and model requests, or to talk with other users, join r/Logfare or the Logfare Discord.

Never post API keys, access tokens or private details publicly. For problems with your own account, open a support ticket in the Discord instead of posting on Reddit.