provider/model ids, and draws on the same balance.
A request on it lands in Activity and on your statement exactly like a chat
request, filed under its own endpoint family so you can tell them apart.
The embeddings endpoint is not served yet; see Embeddings.
Point your existing OpenAI client at https://api.hopscotchlabs.ai and give it a
Hopscotch API key. Nothing else about your code changes.
Base URL
Text completions
POST /v1/completions takes the OpenAI text completion body and returns the
OpenAI text completion object. stream: true is honoured and the stream is
OpenAI’s.
model and max_tokens, and
the handful of request fields we do not meter on our own provider credentials
are refused with a 400 that names the field in param. The list is the one on
OpenAI compatibility,
and it applies only when the request is served on our credentials: on your own
provider key the body is forwarded byte for byte.
The model must be one the catalog lists for the completions family. A model
that exists but is not offered on this endpoint is refused with HTTP 404 and
the code model_not_available, and the message says which families the
catalog does list it for. Ask GET /v1/models for the
endpoint_families of a model before you rely on it here.
Embeddings
Embeddings are not served yet, and we have no date to give. A call toPOST /v1/embeddings is refused with a 404 and the error type
not_found_error, and no vector comes back. The message says the model is not
currently available or is not offered on embeddings.
Until that changes, do not point an embeddings client at this API. If your
framework or tool reaches for an embeddings model by default, set its
embedding model to a provider you call directly. GET /v1/models
shows what is callable today.
Reading what a request cost
The completions endpoint adds no usage header to its reply. The token counts and the charge are on the request’s usage record, which you can read from the dashboard or from the API with the request id every response carries. See Usage lookup.Next
OpenAI compatibility
The full list of endpoints, the fields we refuse, and the headers we add.
Models
How to find which endpoint families a model is offered on.
Every response carries the same id on two headers:
x-hopscotch-request-id,
which is ours, and x-request-id, which is the one the official OpenAI SDKs
surface on their error objects. Every error envelope repeats it as
request_id. Quote it when you ask us about a request. Without it we are
guessing at which of your requests you mean.