---
title: "OpenAI-compatible drop-in: works with any harness"
description: jusCode speaks the OpenAI Chat Completions and Responses APIs. Drop it into Cursor, Aider, Cline, Continue, Goose, or your own agent.
tldr: Any client built for OpenAI works with jusCode. Set base_url to https://api.juscode.co/v1 and api_key to a jcg_ token. Both /v1/chat/completions and /v1/responses are supported. Streaming, tool use, vision, and JSON mode all pass through.
slug: openai-drop-in
order: 3
updated: 2026-05-25
---

# OpenAI-compatible drop-in

If your tool can talk to `api.openai.com`, it can talk to jusCode. Change two lines of config (`base_url` and `api_key`) and you're routed through jusCode with no other code changes. We support both the **Chat Completions** API (`/v1/chat/completions`) and the **Responses** API (`/v1/responses`).

## TL;DR

```
base_url:  https://api.juscode.co/v1
api_key:   jcg_your_key_here   (mint at https://juscode.co/developer)
model:     jusCode-auto        (or any provider/model, we'll route it)
```

That's the entire integration.

## Per-tool quickstart

### Cursor

```
Settings → Models → Override OpenAI Base URL: https://api.juscode.co/v1
Settings → Models → OpenAI API key: jcg_…
```

Toggle "Use custom OpenAI key for all models" → on.

### Aider

```sh
export OPENAI_API_BASE="https://api.juscode.co/v1"
export OPENAI_API_KEY="jcg_..."
aider --model openai/jusCode-auto
```

### Cline (VS Code extension)

```
Cline Settings → API Provider: "OpenAI Compatible"
  Base URL: https://api.juscode.co/v1
  API Key:  jcg_...
  Model:    jusCode-auto
```

### Continue (VS Code / JetBrains)

`~/.continue/config.json`:

```json
{
  "models": [{
    "title": "jusCode",
    "provider": "openai",
    "apiBase": "https://api.juscode.co/v1",
    "apiKey": "jcg_...",
    "model": "jusCode-auto"
  }]
}
```

### Goose (Block)

```sh
goose configure
# Provider: OpenAI
# Host: https://api.juscode.co
# API key: jcg_...
# Model: jusCode-auto
```

### OpenAI SDK (Python)

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.juscode.co/v1",
    api_key="jcg_...",
)

resp = client.chat.completions.create(
    model="jusCode-auto",
    messages=[{"role": "user", "content": "Refactor this function for readability."}],
)
print(resp.choices[0].message.content)
```

### OpenAI SDK (Node)

```ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.juscode.co/v1",
  apiKey: process.env.JUSCODE_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "jusCode-auto",
  messages: [{ role: "user", content: "Explain this stack trace." }],
});
console.log(resp.choices[0].message.content);
```

### curl

```sh
curl https://api.juscode.co/v1/chat/completions \
  -H "Authorization: Bearer jcg_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jusCode-auto",
    "messages": [{"role":"user","content":"Hello"}],
    "stream": true
  }'
```

## What we forward, normalize, or override

| Feature | Behavior |
|---|---|
| `model` | `jusCode-auto` lets us pick; a specific id (e.g. `anthropic/claude-sonnet-4.5`) is honored |
| `messages` | passed through |
| `tools` / `function_call` | normalized between OpenAI and Anthropic shapes automatically |
| `stream: true` | SSE forwarded transparently; usage frame included at end |
| `temperature`, `top_p`, `max_tokens` | passed through (clamped to model limits) |
| `seed`, `logprobs` | passed if upstream supports; ignored if not |
| `usage.cost` (response) | **set by jusCode** in microdollars, even when upstream doesn't report it |

## Responses API

The newer Responses endpoint (`/v1/responses`) is supported with the same auth and base URL. Use it if your harness prefers stateful conversations:

```sh
curl https://api.juscode.co/v1/responses \
  -H "Authorization: Bearer jcg_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jusCode-auto",
    "input": "Write a Python function to compute Fibonacci."
  }'
```

## Errors you might see

| Status | Code | What it means |
|---|---|---|
| 401 | `INVALID_KEY` | Wrong / revoked / expired jcg_ token |
| 402 | `INSUFFICIENT_CREDITS` | Wallet is empty; top up at /developer → Billing |
| 403 | `SEAT_REQUIRED` | >1 member, no seat sub; subscribe in Billing |
| 429 | `RATE_LIMIT` | Per-key or per-tenant RPM; wait or raise the cap |
| 502 | `UPSTREAM_ERROR` | Upstream model temporarily down; retry |

## Uninstall

Remove the jusCode env vars in one command:

```sh
curl -fsSL https://juscode.co/install/uninstall.sh | sh      # macOS · Linux · WSL
irm https://juscode.co/install/uninstall.ps1 | iex           # Windows PowerShell
```

This clears `OPENAI_API_BASE` / `OPENAI_API_KEY` (on Windows, only when they point at jusCode, so a real OpenAI key is left alone). Tools that store the key in their own settings (Cursor, Cline, Continue) also need that entry removed by hand. Full details: [Uninstall jusCode](/docs/uninstall/).

## Related

- [Use jusCode with Claude Code](/docs/claude-code/)
- [Use jusCode with OpenCode](/docs/opencode/)
- [API reference (full schema)](/docs/api-reference/)

---

*Agent-readable raw markdown:* [/docs/openai-drop-in.md](/docs/openai-drop-in.md)
