# OpenAI-Compatible API Quickstart for Uncensored Models

Send a Chat Completions request to `https://api.promptavenue.com/v1/chat/completions` with curl, your PromptAvenue API key, and an Uncensored model ID. For the OpenAI Python or Node.js SDK, set `base_url` or `baseURL` to `https://api.promptavenue.com/v1`. A successful request returns HTTP 200 and a nonempty `choices[0].message.content`.

[Model pricing](https://promptavenue.com/pricing) · [Run the first curl request](https://promptavenue.com/docs/quickstart#first-request)

## Before you start

1. Sign up at [api.promptavenue.com](https://api.promptavenue.com/sign-up?utm_source=docs&utm_medium=guide&utm_campaign=api-quickstart) with your email.
2. Enter the code we send to your email to confirm the address.
3. Add funds by card. See [payment and top-up details](https://promptavenue.com/pricing).
4. Open API keys, click Create API key and copy the key. You will use it as the Bearer token below.

## What you need

- A terminal running Bash or Zsh.
- Use curl 7.76.0 or later for the HTTP example, Python 3.10 or later for the Python example, or Node.js 22 or later for the JavaScript example.

## 1. Create an API key

In the PromptAvenue dashboard, open the API keys page and select **Create API key**. Copy the full key when it appears. In your terminal, paste it when prompted by these commands, then press Enter. The input stays hidden.

```sh
printf 'PromptAvenue API key: '
IFS= read -rs PROMPTAVENUE_API_KEY
printf '\n'
export PROMPTAVENUE_API_KEY
```

Run the example in the same terminal session. Keep the key out of files, browser code, screenshots, and shared logs.

## 2. Run an OpenAI-compatible API curl example

```sh
curl --silent --show-error --fail-with-body \
  'https://api.promptavenue.com/v1/chat/completions' \
  -H "Authorization: Bearer ${PROMPTAVENUE_API_KEY:?Set your PromptAvenue API key first}" \
  -H 'Content-Type: application/json' \
  --data-raw '{
    "model": "deepseek-v4.1-flash-uncensored",
    "messages": [
      {"role": "user", "content": "What does HTTP 429 mean? Answer in one sentence."}
    ]
  }'
```

The JSON body makes curl send a POST request. The `--fail-with-body` option keeps the response body visible on HTTP errors. To display the HTTP status, add `--write-out '\nHTTP %{http_code}\n'` to the curl command.

## 3. Set a custom base URL in the OpenAI Python SDK

Create a virtual environment and install the SDK.

```sh
python3 -m venv .venv
. .venv/bin/activate
python -m pip install openai
```

Save this as `hello_pa.py` and run `python hello_pa.py`.

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.promptavenue.com/v1",
    api_key=os.environ["PROMPTAVENUE_API_KEY"],
)
completion = client.chat.completions.create(
    model="deepseek-v4.1-flash-uncensored",
    messages=[
        {"role": "user", "content": "What does HTTP 429 mean? Answer in one sentence."}
    ],
)
print(completion.choices[0].message.content)
```

## 4. Set a custom baseURL in the OpenAI Node.js SDK

In a new project folder, run `npm init -y` and `npm install openai`. Save this as `hello-pa.mjs` and run `node hello-pa.mjs`.

```js
import OpenAI from "openai";

const apiKey = process.env.PROMPTAVENUE_API_KEY;
if (!apiKey) throw new Error("Set PROMPTAVENUE_API_KEY first.");
const client = new OpenAI({
  baseURL: "https://api.promptavenue.com/v1",
  apiKey,
});
const completion = await client.chat.completions.create({
  model: "deepseek-v4.1-flash-uncensored",
  messages: [{ role: "user", content: "What does HTTP 429 mean? Answer in one sentence." }],
});
console.log(completion.choices[0].message.content);
```

Both SDKs append `/chat/completions` to the base URL. To try GLM with the same prompt, change the model ID to `glm-5.3-flash-uncensored`.

## Verify the response

curl should return HTTP 200 with a JSON body containing a nonempty `choices[0].message.content`. The Python and Node.js examples print that field. Expect a sentence explaining that HTTP 429 means too many requests in a given time. The wording can vary. Here 429 is the subject of the question. The request itself should succeed.

## Example response

The reply is in `choices[0].message.content`. [Something went wrong? See API errors](/docs/quickstart#errors)

```json
{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "HTTP 429 means you sent too many requests in a given time."
    }
  }]
}
```
<a id="errors"></a>

## API errors

- `401` **Token not provided**. Add the header `Authorization: Bearer <your API key>`.
- `401` **Invalid token**. The API key is invalid.
- `401` **This token status is unavailable**. The API key is disabled.
- `403` **Insufficient user quota, remaining quota: {{.Remaining}}**. "Quota" is your balance.
- `403` **Not enough quota to pre-consume for this request: {{.Remaining}} remaining, {{.Required}} required**. The balance is reserved before the request. Reducing `max_tokens` lowers the amount reserved.
- `429` **You have reached the request limit: maximum {{.Max}} requests in {{.Minutes}} minutes**. The limit is 60 requests per minute and 4 at a time. Wait and retry with backoff.
- `503` **Model {{.Model}} is not configured for any group available to this request**. Check the model ID. Use an ID from the [Models page](/models).
- `503` **No available channel for model {{.Model}} under group {{.Group}} (distributor)**. The model is temporarily unavailable. Try again later or use another model.
- `429` **The current group is at capacity. Please try again later, or upgrade your account for better service.** Retry later. Upgrading your account does not apply to PromptAvenue.
- HTTP 400 · Content moderation. Check `error.message` for the reason. Chat Completions returns `request_rejected` in `error.code`. Messages includes this code only for pay-as-you-go requests. No charge applies.
- HTTP 400 · `payg_s3` Content was rejected by pay-as-you-go moderation. No charge applies.
- HTTP 400 · `payg_chat_only` Use /v1/chat/completions for pay-as-you-go requests.
- `relay_failed` A general relay error. Contact support with the request ID if it persists.
- `500` **upstream error: do request failed**. Retry the request. If it keeps failing, contact [support@promptavenue.com](mailto:support@promptavenue.com) with the request ID.

## Common errors

| Symptom | What to check |
| --- | --- |
| Missing environment variable | Set `PROMPTAVENUE_API_KEY` in the terminal where you run the example. |
| Authentication error | Check that the key was created in PromptAvenue and pasted in full. curl sends it after `Bearer`. |
| Route or model error | Check the model ID character for character. curl uses the full `/v1/chat/completions` URL. SDK settings end at `/v1`. |
| Balance or rate-limit error | Read the returned error message. Check the dashboard balance if the error mentions funds. If the request is rate-limited, wait before retrying. |
| Python import or Node.js module error | Install `openai` in the active Python environment or in the folder with your `.mjs` file. |

## Clients

### Cline

API Configuration · **OpenAI Compatible**. Base URL `https://api.promptavenue.com/v1` · API Key `Your PromptAvenue API key` · Model ID `deepseek-v4.1-flash-uncensored`. ![Cline API Configuration showing Base URL, OpenAI Compatible API Key and Model ID.](/assets/clients/cline.png)

### OpenCode

Example provider configuration for DeepSeek V4.1 Flash.

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "promptavenue": {
      "name": "PromptAvenue",
      "env": [
        "PROMPTAVENUE_API_KEY"
      ],
      "models": {
        "deepseek-v4.1-flash-uncensored": {
          "name": "DeepSeek V4.1 Flash"
        }
      },
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://api.promptavenue.com/v1"
      }
    }
  }
}
```
![OpenCode model picker showing an example model under PromptAvenue.](/assets/clients/opencode.png)

### SillyTavern

**API Connections** → **Chat Completion** → **Custom (OpenAI-compatible)**. Custom Endpoint (Base URL) `https://api.promptavenue.com/v1` · Custom API Key `Your PromptAvenue API key` · Enter a Model ID `deepseek-v4.1-flash-uncensored`. ![SillyTavern fields for Custom Endpoint, Custom API Key and Model ID.](/assets/clients/silly.png)

### RisuAI

**Settings → Chat Bot** · **Custom API** · **OpenAI Compatible**. URL `https://api.promptavenue.com/v1/chat/completions` · Key/Password `Your PromptAvenue API key` · Request Model `deepseek-v4.1-flash-uncensored`. ![RisuAI fields for URL, Key/Password, Request Model and OpenAI Compatible format.](/assets/clients/risu.png)

## API FAQ

### What does “no filter” or “no content restrictions” mean for this API?

Uncensored identifies the model variant. DeepSeek V4.1 Flash Uncensored is abliterated. The modification method for GLM-5.3-Flash Uncensored has not been disclosed. Models can still refuse individual requests. The [Acceptable Use Policy](https://promptavenue.com/acceptable-use) applies.
