Everything you need to integrate Mercatus into your workflow.
Get up and running with Mercatus API in under 5 minutes. Our API is compatible with the OpenAI SDK, making migration seamless.
Sign up at Mercatus and navigate to your Account Dashboard → API Keys to generate a new key.
# Using npm
npm install gpu-exchanges
# Using pip
pip install gpu-exchanges
# Or use the OpenAI SDK with our base URL
npm install openaiimport OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.mercatus.com/v1",
apiKey: "sk-yotta-your-api-key",
});
const response = await client.chat.completions.create({
model: "deepseek/deepseek-r1",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);The API is fully compatible with the OpenAI SDK. Just change the base URL and API key.
from openai import OpenAI
client = OpenAI(
base_url="https://api.mercatus.com/v1",
api_key="sk-yotta-your-api-key",
)
response = client.chat.completions.create(
model="anthropic/claude-3.5-sonnet",
messages=[{"role": "user", "content": "Explain GPU pricing"}],
)
print(response.choices[0].message.content)