Providers
The providers Lykia connects to directly, with the ids used in routing preferences and responses.
Markdown/v1/providersReturns the providers Lykia connects to directly, sorted by name. The slug values here are the ids you use in the provider object of a POST /chat/completions request (order, only, ignore), the ones you see in the provider field of responses, and the ones you pick when you add a provider key to a project. If Lykia has no key of its own at a listed provider, that provider's models can be used only once you add your own key for it to your project; GET /models shows which models your project can use.
Example
curl https://api.getlykia.com/v1/providers \
-H "Authorization: Bearer $LYKIA_API_KEY"import os
import requests
response = requests.get(
"https://api.getlykia.com/v1/providers",
headers={"Authorization": f"Bearer {os.environ['LYKIA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
for provider in response.json()["data"]:
print(provider["slug"], provider["name"], provider["headquarters"])const response = await fetch("https://api.getlykia.com/v1/providers", {
headers: { Authorization: `Bearer ${process.env.LYKIA_API_KEY}` },
});
if (!response.ok) {
throw new Error(`Lykia returned ${response.status}: ${await response.text()}`);
}
const { data: providers } = await response.json();
for (const provider of providers) {
console.log(provider.slug, provider.name, provider.headquarters);
}package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(http.MethodGet, "https://api.getlykia.com/v1/providers", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("LYKIA_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusOK {
panic(fmt.Sprintf("Lykia returned %d: %s", resp.StatusCode, body))
}
var result struct {
Data []struct {
Slug string `json:"slug"`
Name string `json:"name"`
Headquarters string `json:"headquarters"`
} `json:"data"`
}
if err := json.Unmarshal(body, &result); err != nil {
panic(err)
}
for _, provider := range result.Data {
fmt.Println(provider.Slug, provider.Name, provider.Headquarters)
}
}{
"data": [
{
"name": "Anthropic",
"slug": "anthropic",
"privacy_policy_url": null,
"terms_of_service_url": null,
"status_page_url": null,
"headquarters": null,
"datacenters": null
},
{
"name": "OpenAI",
"slug": "openai",
"privacy_policy_url": null,
"terms_of_service_url": null,
"status_page_url": null,
"headquarters": null,
"datacenters": null
}
]
}Response
The response is a data array of provider objects.
namestringDisplay name.
slugstringThe provider id, for example anthropic. Routing preferences refer to providers by this value.
privacy_policy_urlstring | nullThe provider's privacy policy.
terms_of_service_urlstring | nullThe provider's terms of service.
status_page_urlstring | nullThe provider's status page.
headquartersstring | nullTwo-letter code of the country where the provider is based.
datacentersstring[] | nullCountry codes of its data centres.
To send requests to particular providers or keep some out, see Provider routing.