feat(vercel-ai-gateway): support embeddings, images and credit usage
Extend Vercel AI Gateway beyond chat: add OpenAI-compatible embeddings and image generation endpoints, credit balance fetch on the usage dashboard, retry on 429, and models catalog fetcher. Thinking/reasoning mapping is omitted pending a project-wide refactor. Co-authored-by: Ngô Tấn Tài <tantai@newnol.io.vn> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import openaiCompatNode from "./openaiCompatNode.js";
|
||||
const OPENAI_COMPAT_PROVIDERS = [
|
||||
"openai", "openrouter", "mistral", "voyage-ai", "fireworks",
|
||||
"together", "nebius", "github", "nvidia", "jina-ai",
|
||||
"vercel-ai-gateway",
|
||||
];
|
||||
|
||||
const ADAPTERS = {
|
||||
|
||||
@@ -12,6 +12,7 @@ const ENDPOINTS = {
|
||||
github: "https://models.github.ai/inference/embeddings",
|
||||
nvidia: "https://integrate.api.nvidia.com/v1/embeddings",
|
||||
"jina-ai": "https://api.jina.ai/v1/embeddings",
|
||||
"vercel-ai-gateway": "https://ai-gateway.vercel.sh/v1/embeddings",
|
||||
};
|
||||
|
||||
export default function createOpenAIEmbeddingAdapter(providerId) {
|
||||
|
||||
Reference in New Issue
Block a user