← Todos os artigos
API

Use the Claude API as a drop-in endpoint on OneHop

Most teams do not need a migration project to try Claude Fable 5. If your app already calls an AI model through an SDK, OneHop is designed to be a drop-in endpoint: change the base URL, set your key, and keep the rest of your request flow intact.

Anthropic SDK shape

If your application already uses Anthropic's Messages API, keep your request structure. Configure the OneHop base URL, provide your OneHop API key, and set the model to claude-fable-5.

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.ONEHOP_API_KEY,
  baseURL: "https://api.onehop.ai/anthropic",
});

const message = await client.messages.create({
  model: "claude-fable-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Draft a launch checklist." }],
});

OpenAI-compatible shape

Teams with OpenAI-compatible tooling can use the same idea: keep the client, swap the endpoint, and call the OneHop model name.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ONEHOP_API_KEY,
  baseURL: "https://api.onehop.ai/v1",
});

const response = await client.chat.completions.create({
  model: "claude-fable-5",
  messages: [{ role: "user", content: "Summarize this pull request." }],
});

Why route through OneHop

The practical benefit is speed: you can test Claude Fable 5 in an existing service before you commit to a larger vendor or gateway change. New OneHop accounts also get $10 in free credit, so you can run real prompts before adding a card.

Start with $10 free credit