Guides
SDKs
Use the official OpenAI and Anthropic SDKs. Change the base URL and the key.
NotHoly does not ship its own SDK. The official OpenAI and Anthropic SDKs work after you change two settings.
| SDK | Base URL | Key |
|---|---|---|
| OpenAI (Python, JavaScript, Go, others) | https://api.notholy.com/v1 | NOTHOLY_API_KEY as the API key |
| Anthropic (Python, JavaScript) | https://api.notholy.com | NOTHOLY_API_KEY as the API key |
OpenAI SDK
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)import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({ baseURL: 'https://api.notholy.com', apiKey: process.env.NOTHOLY_API_KEY });
const m = await client.messages.create({
model: 'notholy-specter',
max_tokens: 512,
messages: [{ role: 'user', content: 'What is CWE-89?' }],
});
console.log(m.content[0].type === 'text' ? m.content[0].text : '');