this is an issue with OpenRouter returning an error but with a 200 http code
this is an issue with OpenRouter returning an error but with a 200 http code
ai-gateway or cache will get mixed up?
--header 'cf-aig-metadata: {"team": "AI", "user": 12345, "test":true}' \

workers <> ai gateway <> model provider? Or also workers <> model providers, another case that I'm hitting is that I'm creating context caches at Google Gemini APIs that can take quite a long time, with larger contexts, e.g. a lot of big files, this takes over 100 seconds and I can't use the API gateway for this as far as I know.



https://router.huggingface.co/novita/v3/openai/chat/completions
https://api.openai.com/v1/audio/transcriptions is used insteadai-gatewayimport { createWorkersAI } from 'workers-ai-provider';
import { streamText } from 'ai';
...
const model = '@cf/meta/llama-3.1-70b-instruct';
const workersai = createWorkersAI({ binding: env.AI,
gateway: {
id: "ai-gateway-id ?"
},
baseURL: 'https://gateway.ai.cloudflare.com/...?'
});
...
const result = streamText({
model: workersai(model),
prompt: finalPrompt,
});--header 'cf-aig-metadata: {"team": "AI", "user": 12345, "test":true}' \filters: [{"key":"metadata.value","operator":"eq","value":["12345"]},{"key":"metadata.key","operator":"eq","value":["user"]},{"key":"created_at","operator":"gt","value":["2025-04-18T01:21:00.000Z"]}]filters: [{"key":"metadata.value","operator":"eq","value":[12345]},{"key":"metadata.key","operator":"eq","value":["user"]},{"key":"created_at","operator":"gt","value":["2025-04-18T01:21:00.000Z"]}]import Anthropic from "@anthropic-ai/sdk";
const anthropic = new Anthropic({
apiKey: "<api key>",
baseURL:
"https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/grok",
});
const msg = await anthropic.messages.create({
model: "grok-beta",
max_tokens: 128,
system:
"You are Grok, a chatbot inspired by the Hitchhiker's Guide to the Galaxy.",
messages: [
{
role: "user",
content: "What is the meaning of life, the universe, and everything?",
},
],
});
console.log(msg);workers <> ai gateway <> model providerworkers <> model providershttps://router.huggingface.co/novita/v3/openai/chat/completions{
"error": {
"message": "The audio file could not be decoded or its format is not supported.",
"type": "invalid_request_error",
"param": null,
"code": null
}
}https://api.openai.com/v1/audio/transcriptions