AI models are pretty resource intensive, and we don't just run everything on one piece of hardware. The SiteHost AI API - accessible at https://ai.sitehost.nz/ - is what brings everything together. It's OpenAI (Cohere, for embeddings/reranking) compatible, so you can plug many existing harnesses into it.
The API's primary job is to handle routing. This means you hit a single endpoint, and your request is sent to the lowest-load AI backend that's serving the model you're looking for. You might want to make use of the cache (for now, faster requests, but we're working on also exposing cheaper rates for cached requests). You can do this by pinning your session with an X-Session-ID request header (we also accept some common alternatives). Some harnesses such as OpenCode will handle this for you.
Because we route requests based on model, if you hit an invalid endpoint with a valid model - for example, an embedding endpoint with a generative model - you'll get an HTTP 404 Not Found as the model in question won't be serving the invalid endpoint.
To check the status of the API, we recommend using the /health endpoint which requires no authentication. If the API is serving normally, you should get a 200 response code with a {"status":"ok"} body. To check the service status of any particular model, you should use the /v1/models endpoint outlined in the authentication section.
To gain access to the API, you'll need to create an AI API Key. You are able to set certain restrictions on the key that will determine what it can access, and where from. You need to include a valid authorisation header (e.g. Authorization: Bearer YOUR_KEY_HERE along with any requests to the API for access.
You can validate a key using the /v1/models OpenAI-compatible endpoint, which exposes all currently-available and authenticated models for a given key:
❯ curl -s https://ai.sitehost.nz/v1/models -H "Authorization: Bearer YOUR_KEY_HERE" | jq
{
"object": "list",
"data": [
{
"id": "Qwen/Qwen3-VL-Embedding-8B",
"object": "model",
"created": 1782767710,
"owned_by": "sitehost"
},
{
"id": "Qwen/Qwen3.6-27B",
"object": "model",
"created": 1782767710,
"owned_by": "sitehost"
}
]
}
When making requests against the API, you may on occasion encounter error responses - you'll never be billed for a failed request, but errors can be informational. Any 'good' response will come alongside an HTTP 2xx response code.
HTTP 4xx response codes are client errors. Alongside the error codes, you will usually get a descriptive message indicating what issue has been encountered.
model key (required for routing).Any HTTP 5xx errors indicate something is wrong with the server. Typically, we'd recommend retrying your request after waiting a few seconds, as these are typically temporary. If you're experiencing recurrent HTTP 5xx errors, especially if triggered by certain inputs, please get in touch with us at support@sitehost.co.nz.
For specific details regarding different capabilities, check out the following sections: