Skip to content
Skillv1.0.0

clade-multi-env-setup

Configure Claude across dev, staging, and production with different Use when working with multi-env-setup patterns. models, keys, and rate limits per environment. Trigger with "anthropic environments"

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/clade-multi-env-setup/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill clade-multi-env-setup. Copyright stays with the author (MIT).

Anthropic Multi-Environment Setup

Overview

Use different API keys, models, and limits across dev/staging/prod.

Environment Configuration

// config/anthropic.ts
interface AnthropicConfig {
  apiKey: string;
  model: string;
  maxTokens: number;
  maxRetries: number;
}

const configs: Record<string, AnthropicConfig> = {
  development: {
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: 'claude-haiku-4-5-20251001', // Cheap for dev
    maxTokens: 256,
    maxRetries: 1,
  },
  staging: {
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: 'claude-sonnet-4-20250514',
    maxTokens: 1024,
    maxRetries: 2,
  },
  production: {
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: 'claude-sonnet-4-20250514',
    maxTokens: 4096,
    maxRetries: 3,
  },
};

export const config = configs[process.env.NODE_ENV || 'development'];

Separate API Keys Per Environment

Use different Anthropic API keys for each environment:

  • Dev key: Low tier, spending alerts at $10
  • Staging key: Medium tier, spending alerts at $50
  • Prod key: Highest tier, spending alerts at usage baseline + 50%
# .env.development
ANTHROPIC_API_KEY=sk-ant-dev-...

# .env.staging
ANTHROPIC_API_KEY=sk-ant-staging-...

# .env.production
ANTHROPIC_API_KEY=sk-ant-prod-...

Model Selection Strategy

Environment Model Why
Development Haiku Fast iteration, cheap
Staging Sonnet Match prod quality
Production Sonnet (default) Balanced cost/quality
Production (complex) Opus Complex reasoning tasks

Output

  • Environment-specific Anthropic configuration (model, maxTokens, maxRetries)
  • Separate API keys per environment with appropriate tier limits
  • Spending alerts configured per environment
  • Dev using Haiku (cheap), staging matching prod (Sonnet), prod using Sonnet/Opus

Error Handling

Error Cause Solution
API Error Check error type and status code See clade-common-errors

Examples

See Environment Configuration TypeScript pattern, API key separation strategy, and Model Selection Strategy table above.

Resources

Next Steps

See clade-observability for monitoring across environments.

Prerequisites

  • Completed clade-install-auth
  • Multiple environments (dev/staging/prod) configured
  • Separate Anthropic API keys created per environment

Instructions

Step 1: Review the patterns below

Each section contains production-ready code examples. Copy and adapt them to your use case.

Step 2: Apply to your codebase

Integrate the patterns that match your requirements. Test each change individually.

Step 3: Verify

Run your test suite to confirm the integration works correctly.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-clade-multi-e-603fbc/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-clade-multi-e-603fbc.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-clade-multi-e-603fbc",
  "kind": "skill",
  "name": "clade-multi-env-setup",
  "description": "Configure Claude across dev, staging, and production with different Use when working with multi-env-setup patterns. models, keys, and rate limits per environment. Trigger with \"anthropic environments\", \"claude staging\", \"anthropic dev vs prod\", \"claude multi-environment\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "saas",
      "anthropic",
      "claude",
      "environments",
      "config",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Configure Claude across dev, staging, and production with different Use when working with multi-env-setup patterns. models, keys, and rate limits per environment. Trigger with \"anthropic environments\", \"claude staging\", \"anthropic dev vs prod\", \"claude multi-environment\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/clade-multi-env-setup/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/clade-multi-env-setup/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/clade-multi-env-setup/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit"
    ],
    "license": "MIT"
  },
  "instructions": "# Anthropic Multi-Environment Setup\n\n## Overview\n\nUse different API keys, models, and limits across dev/staging/prod.\n\n## Environment Configuration\n\n```typescript\n// config/anthropic.ts\ninterface AnthropicConfig {\n  apiKey: string;\n  model: string;\n  maxTokens: number;\n  maxRetries: number;\n}\n\nconst configs: Record<string, AnthropicConfig> = {\n  development: {\n    apiKey: process.env.ANTHROPIC_API_KEY!,\n    model: 'claude-haiku-4-5-20251001', // Cheap for dev\n    maxTokens: 256,\n    maxRetries: 1,\n  },\n  staging: {\n    apiKey: process.env.ANTHROPIC_API_KEY!,\n    model: 'claude-sonnet-4-2025051",
  "cost": {
    "context_tokens": 713
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-clade-multi-e-603fbc/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.