Documentation

API Reference

The gateway speaks the OpenAI API format. If your code works with OpenAI, it works with Gujiata AI by changing the base URL and key.

Base URL & authentication

Base URL: https://gujiata.com/v1

Headers:
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

Create API keys from the console. Keys are shown once at creation — store them securely. Requests are billed to the wallet of the key owner.

Chat completions

POST /v1/chat/completions — create a model response for a conversation.

curl https://gujiata.com/v1/chat/completions \
  -H "Authorization: Bearer sk-gujiata-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4.1",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain quantum tunneling in one sentence."}
    ],
    "temperature": 0.7
  }'

Python

from openai import OpenAI

client = OpenAI(
    api_key="sk-gujiata-xxxxxxxx",
    base_url="https://gujiata.com/v1",
)

resp = client.chat.completions.create(
    model="claude-sonnet-4",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk-gujiata-xxxxxxxx",
  baseURL: "https://gujiata.com/v1",
});

const resp = await client.chat.completions.create({
  model: "gemini-2.5-flash",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

Request fields

FieldTypeRequiredNotes
modelstringyesAny model ID from the catalog.
messagesarrayyesStandard OpenAI message array.
streambooleannoEnables SSE streaming (see below).
temperature, max_tokens, top_p, toolsnoForwarded to the upstream provider unchanged.

List models

GET /v1/models — returns the models currently enabled on the gateway.

curl https://gujiata.com/v1/models \
  -H "Authorization: Bearer sk-gujiata-xxxxxxxx"

Streaming

Set "stream": true to receive server-sent events. Chunks are proxied byte-for-byte from the upstream provider, so your existing OpenAI streaming code works unchanged.

curl https://gujiata.com/v1/chat/completions \
  -H "Authorization: Bearer sk-gujiata-xxxxxxxx" \
  -d '{
    "model": "deepseek-chat",
    "messages": [{"role":"user","content":"Count to five."}],
    "stream": true
  }'

Errors

HTTPtypeMeaning
401authentication_errorMissing or invalid API key.
402billing_errorInsufficient wallet balance — please recharge.
400invalid_request_errorMalformed request or unknown model.
503server_errorNo upstream channel is currently serving the requested model.
{
  "error": {
    "message": "Insufficient balance. Please recharge your wallet.",
    "type": "billing_error"
  }
}

Recharging your wallet

  1. Open the wallet and submit a recharge request with the amount you plan to send.
  2. Our support team emails you the bank account details at your registered address.
  3. Complete the transfer, keep the receipt, and reply to the email.
  4. Your balance is credited as soon as the transfer is confirmed — you can watch it land in your console.

Questions? Use the contact form, leave your email and we will get back to you.