{"slug": "replace-your-openai-anthropic-or-google-api-call-with-middleware", "title": "Replace Your OpenAI, Anthropic or Google API Call with Middleware", "summary": "Middleware is being built to train open-weight models on the corrections developers already make to recurring AI tasks, letting teams replace or supplement calls to OpenAI, Anthropic or Google APIs through the API their application already uses. The tool receives calls from an application, records whether outputs were accepted or corrected, and uses reviewed examples to train models for tasks such as invoice field extraction, with results compared against the current model on examples outside the training set. Middleware also points to OpenRouter for accessing multiple providers through a common API and to context engineering as a way to improve individual responses without changing a model's trained behavior.", "body_md": "## Train models for your\n\nrecurring tasks.\n\nModel APIs made it easier to add text generation, document extraction and other language tasks to an application. Developers could build a first version with a prompt and an API call.\n\nRunning those applications often requires repeated corrections. A document parser may misread the same field. A support tool may need the same wording changed before a reply can be sent.\n\nThose corrections describe requirements specific to the application. We’re building Middleware to use that feedback to train models for tasks the application performs regularly.\n\n### Access to more models through an API\n\nTeams can choose from hosted models and open-weight models, then compare their performance on the same workload. Open-weight models also allow developers to train and run versions suited to a particular task.\n\n[OpenRouter](https://openrouter.ai/docs/quickstart) provides access to multiple providers through a common API. This reduces the integration work needed to compare models or switch providers.\n\nModel selection still requires testing on your own inputs. A model that performs well on general benchmarks may need additional examples or training to handle your document formats, terminology or output requirements.\n\n### Context improves individual responses.\n\n[Context engineering](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) involves selecting the instructions, documents, examples and tools a model receives for a request. These can supply current facts, explain required formats and let a model interact with an application.\n\nFor document extraction, context might include the expected fields and examples of correctly processed documents. It can improve a response without changing the model’s trained behavior.\n\nOnce the task is complete, you can record whether the output was accepted, what needed correction and whether the task succeeded. Reviewed examples can then be used to train a model for similar work.\n\n### Middleware trains models from feedback.\n\nMiddleware receives calls from your application and lets you inspect model performance. We’re building it to use feedback from those calls to train open models for recurring tasks. You can use those models alongside your existing providers.\n\nFor example, a team processing invoices can use corrected field values as training examples. A model trained on those examples can be tested on new invoices to check whether it makes fewer extraction errors.\n\nBefore using a trained model, its results need to be compared with the current model on examples outside the training set. This checks whether the change improves the task you need it to perform.\n\nMiddleware is intended to manage this training process through the API your application already calls. Teams can continue using their existing models and tools.\n\nTeams should spend less time correcting repeated errors and maintaining a separate training pipeline for each task.", "url": "https://wpnews.pro/news/replace-your-openai-anthropic-or-google-api-call-with-middleware", "canonical_source": "https://middleware.now/", "published_at": "2026-09-28 22:07:12+00:00", "updated_at": "2026-09-28 22:17:36.103751+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "large-language-models", "mlops", "ai-infrastructure"], "entities": ["Middleware", "OpenAI", "Anthropic", "Google", "OpenRouter"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/replace-your-openai-anthropic-or-google-api-call-with-middleware", "markdown": "https://wpnews.pro/news/replace-your-openai-anthropic-or-google-api-call-with-middleware.md", "text": "https://wpnews.pro/news/replace-your-openai-anthropic-or-google-api-call-with-middleware.txt", "jsonld": "https://wpnews.pro/news/replace-your-openai-anthropic-or-google-api-call-with-middleware.jsonld"}}