# Keep your code. Change one URL.

> DigitSpace accepts the OpenAI Chat Completions API and Anthropic's Messages API, so existing code works by changing the base URL and the API key. Any model can be called in either format; DigitSpace translates between them.

Source: https://digitspace.ai/features/api-compatibility · Last checked: 2026-10-30

## The whole change

**Before:**
- base_url: https://api.openai.com/v1
- api_key: your OpenAI key
- One provider

**After:**
- base_url: https://api.digitspace.ai/v1
- api_key: your DigitSpace key
- 47 models from 6 providers

## OpenAI SDK

Python, Node.js and any other OpenAI SDK work the same way.

```typescript
import OpenAI from "openai";

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

const reply = await client.chat.completions.create({
  model: "claude-sonnet-5-5", // any model, in OpenAI's format
  messages: [{ role: "user", content: "Hello" }],
});
```

## Anthropic SDK and Claude Code

Point Anthropic's SDK, or Claude Code, at the gateway without /v1.

```bash
export ANTHROPIC_BASE_URL=https://api.digitspace.ai
export ANTHROPIC_AUTH_TOKEN=$DIGITSPACE_API_KEY
claude
```

## What's supported

| Feature | Chat Completions | Messages |
| --- | --- | --- |
| Streaming | Yes | Yes |
| Tools and tool choice | Yes | Yes |
| Images in messages | Yes | Yes |
| JSON and JSON schema output | Yes | Through tools |
| Prompt caching | Passed through to providers that support it | Yes |
| Embeddings, images, audio | Not yet | Not yet |

## Questions

### Do I need a different SDK?

No. Use the OpenAI or Anthropic SDK you already have.

### Can I call a GPT model through the Anthropic API?

Yes. DigitSpace translates the request and the answer, streaming included.

### Which tools work with it?

Anything that lets you set an OpenAI-compatible base URL: LangChain, the Vercel AI SDK, LlamaIndex, Cursor, Cline, Aider, OpenCode and more.

## Related

- [How it works](https://digitspace.ai/how-it-works)
- [OpenAI-compatible APIs](https://digitspace.ai/learn/openai-compatible-api)
- [Docs](https://digitspace.ai/docs)
- [Coding agents](https://digitspace.ai/solutions/coding-agents)

Start free: https://digitspace.ai/signup · Docs: https://digitspace.ai/docs · Pricing: https://digitspace.ai/pricing
