Skip to content
Developer Preview — APIs and language features may change before 1.0

AI Providers

mashin is provider-agnostic. Reasoning steps (ask) work with any supported provider. You choose the provider; mashin handles the governance.

Quick Setup

Set one environment variable. mashin auto-discovers available models.

Terminal window
# Pick one (or several)
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export GOOGLE_API_KEY="AIza..."

That’s it. Your machines can now run reasoning steps. mashin automatically selects the best model for each tier (fast, standard, capable) from whichever providers have keys configured.

Supported Providers

Direct Providers

These connect directly to the provider’s API.

ProviderEnvironment VariableFree TierBest For
AnthropicANTHROPIC_API_KEYNoClaude models. Strongest reasoning.
OpenAIOPENAI_API_KEYNoGPT models. Broad ecosystem.
Google AI StudioGOOGLE_API_KEYYes (rate-limited)Gemini models. Free for prototyping.
GroqGROQ_API_KEYYes (rate-limited)Fastest inference. Great for high-throughput.
xAIXAI_API_KEYNoGrok models.
DeepSeekDEEPSEEK_API_KEYNoDeepSeek reasoning models. Very cost-effective.
MistralMISTRAL_API_KEYNoMistral models. Strong for European deployments.

Aggregators

Route to multiple providers through a single API key.

ProviderEnvironment VariableFree TierBest For
OpenRouterOPENROUTER_API_KEYYes (select models)One key, many providers. Free model access.
Together AITOGETHER_API_KEYNoOpen-source model hosting.

Enterprise / Cloud

For organizations with existing cloud infrastructure.

ProviderEnvironment VariablesBest For
Azure OpenAIAZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEYEnterprise compliance, data residency.
AWS BedrockAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGIONAWS-native deployments.
Google Vertex AIVERTEX_PROJECT_ID, VERTEX_API_KEYGCP-native deployments.

Local Models

No API key needed. Run models on your own hardware.

ProviderSetupBest For
OllamaInstall Ollama, then ollama pull llama3.2:3bPrivacy, offline development, no costs.

Getting Started for Free

If you want to run reasoning steps without spending money, these are your options:

Free tier with generous rate limits. Sign up at aistudio.google.com, create an API key, and set it:

Terminal window
export GOOGLE_API_KEY="AIzaSy..."

Your machines will use Gemini models automatically.

Option 2: OpenRouter (access to many models)

Sign up at openrouter.ai. Some models are free. Set your key:

Terminal window
export OPENROUTER_API_KEY="sk-or-..."

Filter by free models in their dashboard to avoid charges.

Option 3: Groq (fastest inference)

Sign up at console.groq.com. Free tier with rate limits. Set your key:

Terminal window
export GROQ_API_KEY="gsk_..."

Groq runs open-source models on custom hardware. Response times are often under 200ms.

Option 4: Ollama (fully local, no account needed)

Install Ollama, pull a model, and go:

Terminal window
ollama pull llama3.2:3b

No API key needed. mashin detects Ollama automatically. Models run on your machine, completely offline.

Using a Provider in Your Machine

Specify the provider and model in your ask step:

machine classifier
accepts
text as text, required
responds with
category as text
implements
ask classify, using: "anthropic:claude-sonnet-4-6"
with task
"Classify this text into a category."

The format is provider:model. Examples:

anthropic:claude-sonnet-4-6
openai:gpt-5.3-chat-latest
google:gemini-2.5-pro
groq:llama-3.3-70b-versatile
openrouter:anthropic/claude-sonnet-4-6
ollama:llama3.2:3b
deepseek:deepseek-chat
mistral:mistral-large-latest

Model Tiers

If you don’t specify a model, mashin selects one based on the step’s tier:

TierUse CaseExample Selection
fastHigh throughput, simple tasksClaude Haiku, GPT-5.4 Mini, Gemma
standardGeneral reasoning (default)Claude Sonnet, GPT-5.3, Gemini Pro
capableComplex reasoning, escalationClaude Opus, GPT-5.4, o3

mashin auto-discovers the latest models from each configured provider on startup. You always get the newest available model in each tier without changing your machine definitions.

Multiple Providers

Configure as many providers as you want. mashin uses them for:

  • Fallback: If one provider is down, reasoning steps can route to another
  • Cost optimization: Use cheaper providers for simple tasks, premium for complex ones
  • Compliance: Route sensitive data through providers that meet your data residency requirements
Terminal window
# Production setup: primary + fallback
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
# Development: free provider for iteration
export GOOGLE_API_KEY="AIzaSy..."

Testing Without Any Provider

Every machine can be tested without an API key. The assuming block provides deterministic mock values:

machine classifier
accepts
text as text, required
responds with
category as text
implements
ask classify, using: "anthropic:claude-sonnet-4-6"
with task "Classify this text."
assuming
category: "general"
Terminal window
mashin test classifier.mashin
# Uses mock values. No API call. No key needed.

Tests are fast, free, and deterministic. Use them for CI, development iteration, and verifying machine structure before connecting a live provider.