Developer reference

ApiShift API Docs

Static documentation for the planned ApiShift token access API. Requests shown here are examples only and are not executed by this site.

Base URL

Use the following base URL for preview API requests. This is the temporary preview endpoint. A custom API domain can be added later.

https://apishift-api.2630935407.workers.dev/v1

Authentication

Use your ApiShift access token as the bearer token.

Authorization: Bearer as_test_demo_001

Worker health check

This preview check is for local testing and is not a final production API domain.

https://apishift-api.2630935407.workers.dev/health
Python example
import json
from urllib.request import Request, urlopen

base_url = "https://apishift-api.2630935407.workers.dev/v1"
api_key = "as_test_demo_001"

payload = {
    "model": "fast-chat",
    "messages": [
        {"role": "user", "content": "Write a short welcome message."}
    ]
}

request = Request(
    f"{base_url}/chat/completions",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api_key}"
    },
    method="POST"
)

with urlopen(request) as response:
    data = json.loads(response.read().decode("utf-8"))
    print(data)
JavaScript fetch example
const response = await fetch("https://apishift-api.2630935407.workers.dev/v1/chat/completions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer as_test_demo_001"
  },
  body: JSON.stringify({
    model: "fast-chat",
    messages: [
      { role: "user", content: "Write a short welcome message." }
    ]
  })
});

const data = await response.json();
console.log(data);

Error codes

  • 401 Invalid token
  • 402 Insufficient credits
  • 429 Rate limited
  • 500 Service unavailable

Disclaimer

ApiShift is an independent setup and integration service, not an official OpenAI service.