Skip to content
NotHolyDocs

Guides

SDKs

Use the official OpenAI and Anthropic SDKs. Change the base URL and the key.

View as Markdown

NotHoly does not ship its own SDK. The official OpenAI and Anthropic SDKs work after you change two settings.

SDKBase URLKey
OpenAI (Python, JavaScript, Go, others)https://api.notholy.com/v1NOTHOLY_API_KEY as the API key
Anthropic (Python, JavaScript)https://api.notholy.comNOTHOLY_API_KEY as the API key

OpenAI SDK

Python
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.notholy.com/v1", api_key=os.environ["NOTHOLY_API_KEY"])

r = client.chat.completions.create(model="notholy-specter", messages=[{"role": "user", "content": "What is CWE-79?"}])
print(r.choices[0].message.content)

Anthropic SDK

import os
from anthropic import Anthropic

client = Anthropic(base_url="https://api.notholy.com", api_key=os.environ["NOTHOLY_API_KEY"])
m = client.messages.create(
    model="notholy-specter",
    max_tokens=512,
    messages=[{"role": "user", "content": "What is CWE-89?"}],
)
print(m.content[0].text)

Next