OpenAI-compatible chat provider for Speka, including API key validation and quota observation. Reuse when integrating Speka as an LLM backend with shared chat/embedding billing.
// Source: https://github.com/tashfeenahmed/freellmapi | License: MIT | Copyright 2026 Tashfeen Ahmed
// Provided via justclaw.it.com; keep this notice with the code.
import { providerHttpError, type KeyValidationResult } from './base.js';
import { OpenAICompatProvider } from './openai-compat.js';
import { providerTimeoutMs } from '../lib/provider-timeout.js';
import { recordQuotaObservationsFromResponse, type QuotaObservationContext } from '../services/provider-quota.js';
export const SPEKA_BASE_URL = 'https://speka.me/v1';
const VALIDATION_MODEL = '__freellmapi_key_validation__';
/** OpenAI-compatible chat; model rows are delivered only by the signed catalog.
* Free's $1/month is shared across chat and embeddings, not a per-model grant.
* Docs: https://speka.me/docs and https://speka
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key