Skip to content
skyl

Compatible endpoints

Verified base URLs for hosts that speak OpenAI's wire format.

Every host below is reachable through provider/openaicompat with one constructor and no skyl code. Four of them run on your own machine.

The endpoints#

HostBase URLKey?Notes
xAI (Grok)https://api.x.ai/v1Required
DeepSeekhttps://api.deepseek.com/v1Required
Mistralhttps://api.mistral.ai/v1Required
Groqhttps://api.groq.com/openai/v1Required
Togetherhttps://api.together.xyz/v1Required
Fireworkshttps://api.fireworks.ai/inference/v1Required
OpenRouterhttps://openrouter.ai/api/v1RequiredBrokers 300+ models on its own, and supplies DisplayName and ContextWindow on model listing.
Perplexityhttps://api.perplexity.aiRequired
Cerebrashttps://api.cerebras.ai/v1Required
DeepInfrahttps://api.deepinfra.com/v1/openaiRequired
Qwen / DashScopehttps://dashscope.aliyuncs.com/compatible-mode/v1Required
Moonshot (Kimi)https://api.moonshot.cn/v1Required
Z.ai (GLM)https://open.bigmodel.cn/api/paas/v4Required
Nvidia NIMhttps://integrate.api.nvidia.com/v1Required
Ollamahttp://localhost:11434/v1NoneLocal. Needs no credential — omit WithAPIKey entirely.
vLLMhttp://localhost:8000/v1NoneSelf-hosted. Returns content as an array of blocks on some builds, which skyl handles.
LM Studiohttp://localhost:1234/v1NoneLocal.
llama.cpphttp://localhost:8080/v1NoneLocal.

Caveats

  • These implement OpenAI's format, not necessarily its features. Tool calling, streaming and multimodal support vary by host and by model.
  • The four with no key are local runtimes. Omit WithAPIKey entirely rather than passing an empty string.
  • Base URLs change. If one stops working, check the vendor's documentation — skyl does not validate them, so a wrong URL surfaces as that host's own error.
  • Always set WithName, or every host reports the same label.

Usage#

Any hosted endpoint

goCompiles
p := openaicompat.New(
	openaicompat.WithBaseURL("https://api.deepseek.com/v1"),
	openaicompat.WithAPIKey(os.Getenv("DEEPSEEK_API_KEY")),
	openaicompat.WithName("deepseek"),
)
p := openaicompat.New(
	openaicompat.WithBaseURL("https://api.deepseek.com/v1"),
	openaicompat.WithAPIKey(os.Getenv("DEEPSEEK_API_KEY")),
	openaicompat.WithName("deepseek"),
)

A registry of hosts

type host struct {
	name    string
	baseURL string
	envKey  string // empty for local runtimes
}

var hosts = []host{
	{"groq", "https://api.groq.com/openai/v1", "GROQ_API_KEY"},
	{"deepseek", "https://api.deepseek.com/v1", "DEEPSEEK_API_KEY"},
	{"ollama", "http://localhost:11434/v1", ""},
}

func build(h host) skyl.Provider {
	opts := []openaicompat.Option{
		openaicompat.WithBaseURL(h.baseURL),
		openaicompat.WithName(h.name),
	}
	if h.envKey != "" {
		opts = append(opts, openaicompat.WithAPIKey(os.Getenv(h.envKey)))
	}
	return openaicompat.New(opts...)
}
type host struct {
	name    string
	baseURL string
	envKey  string // empty for local runtimes
}

var hosts = []host{
	{"groq", "https://api.groq.com/openai/v1", "GROQ_API_KEY"},
	{"deepseek", "https://api.deepseek.com/v1", "DEEPSEEK_API_KEY"},
	{"ollama", "http://localhost:11434/v1", ""},
}

func build(h host) skyl.Provider {
	opts := []openaicompat.Option{
		openaicompat.WithBaseURL(h.baseURL),
		openaicompat.WithName(h.name),
	}
	if h.envKey != "" {
		opts = append(opts, openaicompat.WithAPIKey(os.Getenv(h.envKey)))
	}
	return openaicompat.New(opts...)
}

Discovering what a host offers

goCompiles
// The answer comes from the host, live — so it is never stale, and it is the
// only reliable way to know what a compatible endpoint actually serves.
models, err := client.Models(ctx)
if err != nil {
	return err
}
for _, m := range models {
	fmt.Println(m.ID)
}
// The answer comes from the host, live — so it is never stale, and it is the
// only reliable way to know what a compatible endpoint actually serves.
models, err := client.Models(ctx)
if err != nil {
	return err
}
for _, m := range models {
	fmt.Println(m.ID)
}

Local runtimes#

Ollama, vLLM, LM Studio and llama.cpp all run on your own hardware and authenticate nothing. This is the case that makes "develop against a local model, deploy against a frontier one" a configuration change rather than two code paths.

goCompiles
func local() skyl.Provider {
	return openaicompat.New(
		openaicompat.WithBaseURL("http://localhost:11434/v1"),
		openaicompat.WithName("ollama"),
	)
}
func local() skyl.Provider {
	return openaicompat.New(
		openaicompat.WithBaseURL("http://localhost:11434/v1"),
		openaicompat.WithName("ollama"),
	)
}

Troubleshooting#

A 404 on every request

Check the base URL includes the version segment. Most of these need /v1; Perplexity does not.

An unexpected 401 against a local runtime

You passed WithAPIKey(""), which still sends an Authorization header. Omit the option entirely.

Model listing returns nothing useful

Coverage is host-dependent. OpenRouter supplies display names and context windows; most others supply only IDs. ModelInfo.Raw has whatever they sent.

Edit this page on GitHub