Skip to content
OpenSmartRoute
Skillv1.0.0

clade-deploy-integration

Deploy Claude-powered applications to Vercel, Fly.io, and Cloud Run Use when working with deploy-integration patterns. with proper secrets management and streaming support. Trigger with "deploy anthro

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 (plugins/saas-packs/claude-pack/skills/clade-deploy-integration/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill clade-deploy-integration. Copyright stays with the author (MIT).

Deploy Anthropic Integration

Overview

Claude integrations are stateless API wrappers — a serverless function receives a user request, streams from the Messages API, and returns the response. No database, no connection pool, no persistent state.

Vercel Edge Function (Recommended)

// app/api/chat/route.ts (Next.js App Router)
import Anthropic from '@claude-ai/sdk';

export const runtime = 'edge';

export async function POST(req: Request) {
  const client = new Anthropic();
  const { messages, system } = await req.json();

  const stream = await client.messages.create({
    model: 'claude-sonnet-4-20250514',
    max_tokens: 4096,
    system: system || 'You are a helpful assistant.',
    messages,
    stream: true,
  });

  // Convert Anthropic stream to ReadableStream for SSE
  const encoder = new TextEncoder();
  const readable = new ReadableStream({
    async start(controller) {
      for await (const event of stream) {
        if (event.type === 'content_block_delta' && event.delta.type === 'text_delta') {
          controller.enqueue(encoder.encode(`data: ${JSON.stringify(event.delta)}\n\n`));
        }
      }
      controller.enqueue(encoder.encode('data: [DONE]\n\n'));
      controller.close();
    },
  });

  return new Response(readable, {
    headers: {
      'Content-Type': 'text/event-stream',
      'Cache-Control': 'no-cache',
    },
  });
}

Instructions

Step 1: Deploy to Vercel

# Add secret
vercel env add ANTHROPIC_API_KEY

# Deploy
vercel --prod

Fly.io (Long-Running / WebSocket)

FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
fly launch --name my-claude-app
fly secrets set ANTHROPIC_API_KEY=sk-ant-api03-...
fly deploy

Google Cloud Run

gcloud run deploy claude-api \
  --source . \
  --region us-central1 \
  --allow-unauthenticated \
  --set-secrets=ANTHROPIC_API_KEY=claude-key:latest \
  --timeout=300 \
  --concurrency=80

Health Check

// api/health.ts
import Anthropic from '@claude-ai/sdk';

export async function GET() {
  try {
    const client = new Anthropic();
    const msg = await client.messages.create({
      model: 'claude-haiku-4-5-20251001',
      max_tokens: 5,
      messages: [{ role: 'user', content: 'ping' }],
    });
    return Response.json({ status: 'healthy', model: msg.model });
  } catch (err) {
    return Response.json({ status: 'unhealthy', error: err.message }, { status: 503 });
  }
}

Environment Variables

Variable Required Description
ANTHROPIC_API_KEY Yes API key from console.anthropic.com
ANTHROPIC_MODEL No Default model ID (override per request)
ANTHROPIC_MAX_TOKENS No Default max tokens

Output

  • Application deployed to chosen platform with streaming support
  • ANTHROPIC_API_KEY stored in platform secrets manager
  • Health check endpoint returning Claude connectivity status
  • Environment-specific configuration (model, max_tokens) in place

Error Handling

Issue Cause Solution
FUNCTION_INVOCATION_TIMEOUT Claude response > function timeout Set timeout to 300s. Use streaming.
Secret not found Missing env var Add via platform CLI
529 in production API overloaded SDK retries automatically. Add fallback model.
CORS errors Missing headers Add CORS headers to API route

Examples

See Vercel Edge Function (with SSE streaming), Fly.io Dockerfile, Cloud Run deploy script, and Health Check endpoint above.

Resources

Next Steps

See clade-observability for monitoring your Claude calls in production.

Prerequisites

  • Completed clade-install-auth and clade-prod-checklist
  • Production Anthropic API key (separate from dev key)
  • Platform CLI installed: vercel, fly, or gcloud
  • Application code tested locally

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-deploy-574ffb/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-deploy-574ffb.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-clade-deploy-574ffb",
  "kind": "skill",
  "name": "clade-deploy-integration",
  "description": "Deploy Claude-powered applications to Vercel, Fly.io, and Cloud Run Use when working with deploy-integration patterns. with proper secrets management and streaming support. Trigger with \"deploy anthropic\", \"claude production deploy\", \"anthropic vercel\", \"deploy claude app\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "saas",
      "anthropic",
      "claude",
      "deploy",
      "production",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Deploy Claude-powered applications to Vercel, Fly.io, and Cloud Run Use when working with deploy-integration patterns. with proper secrets management and streaming support. Trigger with \"deploy anthropic\", \"claude production deploy\", \"anthropic vercel\", \"deploy claude app\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "plugins/saas-packs/claude-pack/skills/clade-deploy-integration/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/saas-packs/claude-pack/skills/clade-deploy-integration/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/plugins/saas-packs/claude-pack/skills/clade-deploy-integration/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(vercel:*),",
      "Bash(fly:*),",
      "Bash(gcloud:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# Deploy Anthropic Integration\n\n## Overview\n\nClaude integrations are stateless API wrappers — a serverless function receives a user request, streams from the Messages API, and returns the response. No database, no connection pool, no persistent state.\n\n## Vercel Edge Function (Recommended)\n\n```typescript\n// app/api/chat/route.ts (Next.js App Router)\nimport Anthropic from '@claude-ai/sdk';\n\nexport const runtime = 'edge';\n\nexport async function POST(req: Request) {\n  const client = new Anthropic();\n  const { messages, system } = await req.json();\n\n  const stream = await client.messages.create({\n",
  "cost": {
    "context_tokens": 1035
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-clade-deploy-574ffb/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.