Build your AI applications with the flexibility to switch between OpenAI and Google models without changing your code. Middlebop provides a unified API, helping you stay flexible and future-proof in a fast moving AI landscape.
Easy to get started
With our Typescript SDK, you can get started in minutes. Just npm install and you're ready to go. The message format and response is always the same.
import { MiddlebopChatMessage, sendChat } from "@middlebop/client";
const middlebopApiKey = "mb-yourSuperSecretApiKey";
const messages: MiddlebopChatMessage[] = [
{
role: "user",
content: {
type: "text",
text: "Hello, who are you?",
},
},
];
sendChat({
messages,
model: "gpt-4", // any supported model!
middlebopApiKey,
}).then((response) => {
console.log(response.data);
}
Build better apps
With hotswappable models you can make your apps more flexible, faster and price efficient.
Let's get startedYou pay for the number of tokens you process. Create a free account and top up your account balance and start using Middlebop.
Model | Input token price | Output token price |
---|---|---|
gpt-4-0125-preview | $0.011 / 1k tokens | $0.033 / 1k tokens |
gpt-4-1106-preview | $0.011 / 1k tokens | $0.033 / 1k tokens |
gpt-4-1106-vision-preview | $0.011 / 1k tokens | $0.033 / 1k tokens |
gpt-4 | $0.033 / 1k tokens | $0.066 / 1k tokens |
gpt-3.5-turbo-0125 | $0.00055 / 1k tokens | $0.00165 / 1k tokens |
gpt-3.5-turbo | $0.0033 / 1k tokens | $0.0066 / 1k tokens |
gemini-pro | $0.0001375 / 1k characters | $0.0004125 / 1k characters |
claude-3-haiku-20240307 | $0.000275 / 1k tokens | $0.001375 / 1k tokens |
claude-3-sonnet-20240229 | $0.0033 / 1k tokens | $0.0165 / 1k tokens |
claude-3-opus-20240229 | $0.0165 / 1k tokens | $0.0825 / 1k tokens |