The Not Diamond API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

The Not Diamond API uses API keys for authentication. Login to your account to retrieve the API key you'll use in your requests.

All API requests should include your API key in an Authorization HTTP header as follows:

--header 'Authorization: Bearer <ND_API_Key>'
headers = {
  "Authorization": "Bearer <ND API KEY>",
  "Content-Type": "application/json"
}

❗️

Remember that your API key is a secret!

Do not share it with others or expose it in any client-side code (browsers, apps). Production requests must be routed through your own backend server where your API key can be securely loaded from an environment variable or key management service.

API endpoints

You can learn more about each API endpoint via the sidebar links. Our primary endpoint is /modelSelect, which accepts an array of messages and a list of models and returns a recommendation for which LLM to use. Note that our API simply returns a recommendation, and requests to recommended LLMs are then handled client-side. We do not offer a chat completion API or a proxy for calling models.