pub enum OpenCodeProviderType {
Show 45 variants
OpenCodeZen,
ZaiDirect,
ZaiCodingPlan,
Moonshot,
MiniMax,
Anthropic,
OpenAI,
Google,
GoogleVertex,
AmazonBedrock,
AzureOpenAI,
GithubCopilot,
Groq,
Together,
Fireworks,
Cerebras,
SambaNova,
DeepInfra,
OpenRouter,
Cloudflare,
Vercel,
Helicone,
ZenMux,
DeepSeek,
Xai,
Mistral,
Cohere,
Perplexity,
AI21,
VeniceAI,
HuggingFace,
Replicate,
Baseten,
Cortecs,
Scaleway,
OVHcloud,
IONet,
Nebius,
SapAICore,
AzureCognitiveServices,
Ollama,
LMStudio,
OllamaCloud,
LlamaCpp,
Custom,
}Expand description
OpenCode provider type extracted from model flag.
OpenCode supports 75+ providers through the AI SDK and Models.dev.
This enum explicitly lists all major provider categories for clear
identification and provider-specific authentication guidance.
Variants§
OpenCodeZen
OpenCode Zen - gateway for multiple providers via unified API.
ZaiDirect
Z.AI Direct - direct access to Z.AI/ZhipuAI models.
ZaiCodingPlan
Z.AI Coding Plan - Z.AI coding subscription plan.
Moonshot
Moonshot AI / Kimi.
MiniMax
MiniMax AI.
Anthropic
Anthropic (Claude models).
OpenAI
OpenAI (GPT models).
Google AI (Gemini models).
GoogleVertex
Google Vertex AI (enterprise Gemini).
AmazonBedrock
Amazon Bedrock.
AzureOpenAI
Azure OpenAI Service.
GithubCopilot
GitHub Copilot (Chat).
Groq
Groq (fast inference).
Together
Together AI.
Fireworks
Fireworks AI.
Cerebras
Cerebras.
SambaNova
SambaNova.
DeepInfra
DeepInfra.
OpenRouter
OpenRouter (model aggregator).
Cloudflare
Cloudflare Workers AI.
Vercel
Vercel AI Gateway.
Helicone
Helicone (observability + gateway).
ZenMux
ZenMux (AI gateway).
DeepSeek
DeepSeek (coding-focused).
Xai
xAI (Grok).
Mistral
Mistral AI.
Cohere
Cohere.
Perplexity
Perplexity (search-augmented).
AI21
AI21 Labs.
VeniceAI
Venice AI.
HuggingFace
HuggingFace Inference.
Replicate
Replicate.
Baseten
Baseten.
Cortecs
Cortecs.
Scaleway
Scaleway.
OVHcloud
OVHcloud.
IONet
IO.NET.
Nebius
Nebius.
SapAICore
SAP AI Core.
AzureCognitiveServices
Azure Cognitive Services.
Ollama
Ollama (local).
LMStudio
LM Studio (local).
OllamaCloud
Ollama Cloud (remote Ollama).
LlamaCpp
llama.cpp (local).
Custom
Custom/unknown provider (OpenCode may still support it).
Implementations§
Source§impl OpenCodeProviderType
impl OpenCodeProviderType
Sourcepub fn from_model_flag(model_flag: &str) -> Self
pub fn from_model_flag(model_flag: &str) -> Self
Detect provider type from a model flag string.
Source§impl OpenCodeProviderType
impl OpenCodeProviderType
Sourcepub const fn auth_command(self) -> &'static str
pub const fn auth_command(self) -> &'static str
Get authentication command/instructions for this provider.
Sourcepub const fn requires_cloud_config(self) -> bool
pub const fn requires_cloud_config(self) -> bool
Check if this provider requires special cloud configuration.
Source§impl OpenCodeProviderType
impl OpenCodeProviderType
Sourcepub const fn example_models(self) -> &'static [&'static str]
pub const fn example_models(self) -> &'static [&'static str]
Get example models for this provider type.
Trait Implementations§
Source§impl Clone for OpenCodeProviderType
impl Clone for OpenCodeProviderType
Source§fn clone(&self) -> OpenCodeProviderType
fn clone(&self) -> OpenCodeProviderType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpenCodeProviderType
impl Debug for OpenCodeProviderType
Source§impl Hash for OpenCodeProviderType
impl Hash for OpenCodeProviderType
Source§impl PartialEq for OpenCodeProviderType
impl PartialEq for OpenCodeProviderType
impl Copy for OpenCodeProviderType
impl Eq for OpenCodeProviderType
impl StructuralPartialEq for OpenCodeProviderType
Auto Trait Implementations§
impl Freeze for OpenCodeProviderType
impl RefUnwindSafe for OpenCodeProviderType
impl Send for OpenCodeProviderType
impl Sync for OpenCodeProviderType
impl Unpin for OpenCodeProviderType
impl UnwindSafe for OpenCodeProviderType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more