GGitHub采集材料
用统一接口路由多种 AI 模型
发布时间未知 · 北京时间
图像与视频
有实践材料可继续查看
代码仓库使用说明示例代码
原文与观测指标
1 个来源GGitHub
查看原文 用统一接口路由多种 AI 模型
apimart-66星标150采集时的累计值
每小时增长待观察星标 / 小时 · 观测区间平均值
最近提交10-26 21:12提交时间不是项目发布时间
发布时间:未知 · 首次发现 10-27 15:48 · 北京时间
指标采集:10-27 15:48 · 指标已取得
项目文档有线索安装说明未发现使用说明有线索示例有线索
仅反映文档与示例线索,未实际运行项目。
摘要
该项目提供机器可读的模型目录及请求示例,展示如何通过统一的 OpenAI 兼容接口和密钥调用多种模型。示例包括 SDK 与 curl 调用、异步任务轮询、成本计算和安全重试,帮助构建多模型任务路由。
摘要由 AI 生成,请以原文为准。观测历史 · 最近 1 条 展开 / 收起
缺失不计为零;增长只比较同一指标来源的有效记录,按实际间隔折算每小时。上游缓存可能延迟数值更新。
| 采集时间 · 北京时间 | 指标 | 数值 | 来源 | 状态 |
|---|---|---|---|---|
| 10-27 15:48:17 | Star | 150 | GitHub 公开页面 | 已取得 |
采集原文 展开 / 收起
ai-api-aggregator
AI API aggregator companion: machine-readable catalog of 300+ models behind one key and one base URL, with routing patterns, cost account…
项目说明 展开 / 收起
AI API Aggregator — One Key, One Base URL, 300+ Models image2.5 from $0.0085 per 1K image · Seedance 2.5 from $0.0961/sec · cached LLM input from $0.40/M — one OpenAI-compatible endpoint at https://api.apimart.ai/v1, no monthly plan required. (observed 2026-09-17) Get an API key · Live pricing · Model page Why teams route through APIMart One key, entire catalog. The same https://api.apimart.ai/v1 base URL and Authorization header reach the whole catalog behind one key and 300+ other image, video and language models — switch the model field, not your client. $1 minimum, pay as you go. No subscription and no prepaid plan to size up front: top up from $1 and spend it on calls. There is no free quota to burn through first, so the price in this table is the price you pay. The charge comes back in the response. Every call reports the amount billed (cost / credits_cost), so a spend number is read per call instead of guessed at month end. Async by design. Submit, take the task_id, poll GET /v1/tasks/{id} — batching and retries are ordinary queue work, not a bespoke integration. An AI API aggregator concentrates access: one credential, one base URL, one billing surface, many models. This repository is the working companion to that idea — a machine-readable model catalog, the request shapes for each modality behind the same key, and the routing patterns that keep a pipeline from double-charging or silently failing over. 2026-10-26 What is in here File Why it exists data/models.json the full catalog: model id, display name, alias, modality, billing unit, prices CATALOG.md the same catalog as a readable table, regenerated in CI tools/catalog.py builds the catalog from the public pricing payload — no API key needed examples/router.py routes a task to a model, prints the cost arithmetic, retries safely examples/openai_sdk_client.py the OpenAI SDK pointed at the aggregator base URL examples/curl.sh chat, image and async task polling with plain curl Catalog coverage Modality Models captured Typical billing unit Image 45 per delivered image (by resolution) Video 0 per second of output (by resolution) Text / multimodal 4 per million tokens (input / cached / output) Other (per call, per track) 0 fixed unit per call The full list lives in CATALOG.md. Headline routes below are the ones most requests land on. Image routes Model id Route Headline price Billing unit gpt-image-2.5-ext image2.5 per-image route $0.0085 usd_per_image gemini-3-pro-image-preview Nano Banana Pro $0.02 usd_per_image gemini-3.1-flash-image-preview Nano Banana 2 $0.015 usd_per_image gemini-2.5-flash-image-preview Nano Banana $0.008 usd_per_image grok-imagine-1.5-apimart Grok Image 1.5 $0.015 usd_per_image seedream-4-5 Seedance 4.5 image route $0.026 usd_per_image Video routes Model id Route Headline price Billing unit Text and multimodal routes Model id Route Headline price Billing unit One key, several request shapes An aggregator is only useful if the same credential works across modalities. All three shapes below use Authorization: Bearer $APIMART_API_KEY against https://api.apimart.ai/v1. from openai import OpenAI client = OpenAI(base_url="https://api.apimart.ai/v1", api_key=os.environ["APIMART_API_KEY"]) chat = client.chat.completions.create(model="gpt-5.5", messages=[{"role": "user", "content": "Explain idempotency keys"}]) # image route: submit, then poll the task until completed curl -sS https://api.apimart.ai/v1/images/generations \ -H "Authorization: Bearer $APIMART_API_KEY" -H 'Content-Type: application/json' \ -H "Idempotency-Key: $(uuidgen)" \ -d '{"model":"gpt-image-2.5-ext","version":"flare","prompt":"A pasta dish on a slate table, side light","size":"1:1","resolution":"1K","n":1}' # task polling returns status, progress, cost and the result URLs curl -sS https://api.apimart.ai/v1/tasks/task_01EXAMPLE -H "Authorization: Bearer $APIMART_API_KEY" Video routes follow the same envelope with a per-second unit, so a 10-second clip is rate × 10 on the resolution tier you asked for. Routing patterns that hold up in production Route by modality, not by brand. Pick the image route from the image table, the video route from the per-second table, and the text route from the token table; comparing them on one axis (price per artefact) avoids nonsense comparisons. Retry with an idempotency key. 429 and 5xx are retryable, 400 / 401 / 402 are not; reusing the same Idempotency-Key collapses a retry into the original task instead of buying a second image. Poll with backoff, stop on terminal states. pending → processing → completed | failed; schedule the first polls a few seconds apart and widen from there. Log cost per task, not per request. The task response carries cost and credits_cost; summing those is the only reconciliation that matches the invoice. Keep a fallback chain per modality. Same-modality fallback is usually safe; cross-modality fallback is not (an edit prompt rarely survives a different vendor's model). Aggregator or direct vendor? Question Aggregator Direct vendor Credentials to manage one key one per vendor Response envelopes normalised, with a task model for long jobs vendor-specific Model choice swap a string new integration per vendor Pricing model mixed units (per image, per second, per token) under one bill vendor-specific billing Failure modes one hop to debug, provider quirks can leak through fewer layers, fewer abstractions Best fit teams that ship several modalities and want one budget line single-model products with deep vendor-specific needs Estimate before you spend python examples/router.py image --model gpt-image-2.5-ext --count 250 python examples/router.py video --model seedance-2.0-mini --resolution 480P --seconds 8 --count 25 python examples/router.py text --model claude-opus-5 --input-tokens 400000 --output-tokens 60000 python examples/router.py list --spec image | head What that costs at scale Workload Cost at the observed rates 1,000 GPT Image 2.5 renders (1K) $8.50 10 minutes of Seedance 2.5 at 480P