The Conifer SDK simplifies model inference by aggregating access to various AI models through a single API key. It supports TypeScript, Python, and provides an MCP server for broader compatibility. The service itemizes costs down to the nanodollar, ensuring transparency and control over expenditure while making it easy to integrate powerful AI capabilities.
The Conifer SDK provides developers with a unified interface for cloud, local, and Bring Your Own Key (BYOK) inference, ensuring transparency through exact cost receipts for each API call. It is available in both TypeScript and Python, alongside a Machine Communications Protocol (MCP) server to support tools that may not directly communicate with OpenAI or other similar services.
import { Conifer, textOf } from "conifer-sdk";
const conifer = new Conifer();
const answer = await conifer.chat({
model: "claude-haiku-4-5",
messages: [{ role: "user", content: "three names for a build cache" }],
maxTokens: 200,
maxCostNanoUsd: 5_000_000, // restrict to max spend of $0.005
});
console.log(textOf(answer));
console.log(answer.receipt.costUsd); // Exact cost of this API call
from conifer_sdk import Conifer, ChatRequest
conifer = Conifer()
answer = conifer.chat(ChatRequest(
model="claude-haiku-4-5",
messages=[{"role": "user", "content": "three names for a build cache"}],
max_tokens=200,
max_cost_nano_usd=5_000_000,
))
print(answer.text, answer.receipt.cost_usd) # Displays the answer and its cost
The SDK provides extensive details on costs beyond just the response headers, ensuring comprehensive visibility into spending. This empowers teams to analyze usage effectively and make informed decisions.
The Conifer SDK seamlessly interacts with existing tools and libraries, allowing easy migration and integration with minimal changes required. It supports various models through the OpenAI and Anthropic APIs, ensuring that developers can leverage a wide array of capabilities without needing to adjust their processes significantly.
For non-interactive tasks, the SDK allows jobs to be deferred for later execution, providing flexibility in handling high-demand tasks that require asynchronous processing.
By using the Conifer SDK, developers gain a powerful tool that enhances access to AI models while ensuring clarity in operational costs.
No comments yet.
Sign in to be the first to comment.