LLmHub API Documentation
Official API documentation for LLmHub API (api.llmhub.dev)
Introduction
LLMHUB is a smart autorouting system for large language models. It automatically routes your prompt to the best available model and returns the optimal response seamlessly. This API reference describes the RESTful, streaming, and realtime APIs you can use to interact with the LLMHUB platform. REST APIs are accessible via HTTP in any environment that supports HTTP requests. Language-specific SDKs are available on the libraries page.
Authentication
The LLMHUB API uses API keys for authentication. Create, manage, and learn more about API keys in your dashboard.
Remember that your API key is a secret! Do not share it with others or expose it in any client-side code (browsers, apps). API keys should be securely loaded from an environment variable or a key management service on the server.
API keys should be provided via HTTP Bearer authentication.
Authorization: Bearer LLMHUB_API_KEY
If you belong to multiple organizations or access projects through a legacy user API key, pass a header to use for an API request:
curl -L -X GET 'https://api.llmhub.dev/v1/models' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
Backward Compatibility
LLMHUB is committed to providing stability to API users by avoiding breaking changes in major API versions whenever reasonably possible. This includes:
- The REST API (currently v1)
- Our first-party SDKs (released SDKs adhere to semantic versioning)
- Model families (e.g., our specialized and routing models)
- Model prompting behavior between snapshots is subject to change. Model outputs are inherently variable, so expect changes in prompting and model behavior between snapshots. For example, if you move from one model version to another, the same system or user messages could function differently between versions. The best way to ensure consistent prompting behavior and model output is to use pinned model versions and to implement evaluations for your applications.
Backward-compatible API changes include:
- Adding new resources (URLs) to the REST API and SDKs
- Adding new optional API parameters
- Adding new properties to JSON response objects or event data
- Changing the order of properties in a JSON response object
- Changing the length or format of opaque strings, such as resource identifiers and UUIDs
- Adding new event types (in either streaming or the Realtime API)
See the changelog for a list of backwards-compatible changes and rare breaking changes.