Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Migrate from OpenAI/GPT to Anthropic/Claude — API differences, Use when working with migration-deep-dive patterns. prompt adaptation, SDK swap, and feature mapping. Trigger with "migrate to claude", "openai to anthropic", "switch from gpt to claude", "replace openai with anthropic".
.claude/skills/jeremylongshore-clade-migration-deep-dive/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 33% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 245% | 0% |
Migrate from OpenAI/GPT to Anthropic/Claude. Covers the complete API mapping (endpoints, models, response shapes), SDK swap with before/after code, five key differences (max_tokens required, system as top-level param, alternating messages, response path, streaming events), and tool use migration.
| OpenAI | Anthropic | Notes | |--------|-----------|-------| | openai.chat.completions.create() | anthropic.messages.create() | Different request/response shape | | model: 'gpt-4o' | model: 'claude-sonnet-4-20250514' | Different model IDs | | response.choices[0].message.content | response.content[0].text | Different response path | | system in messages array | system as separate parameter | Claude uses top-level system | | response_format: { type: 'json_object' } | System prompt: "Respond in JSON only" | No native JSON mode | | tools / function_calling | tools (similar but different schema) | Input schema differences | | openai.embeddings.create() | N/A — use Voyage or Cohere | No embeddings API |
typescriptimport OpenAI from 'openai'; const openai = new OpenAI(); const response = await openai.chat.completions.create({ model: 'gpt-4o', messages: [ { role: 'system', content: 'You are helpful.' }, { role: 'user', content: 'Hello' }, ], }); console.log(response.choices[0].message.content);
typescriptimport Anthropic from '@claude-ai/sdk'; const anthropic = new Anthropic(); const response = await anthropic.messages.create({ model: 'claude-sonnet-4-20250514', max_tokens: 1024, // Required (not optional like OpenAI) system: 'You are helpful.', // Separate from messages messages: [ { role: 'user', content: 'Hello' }, ], }); console.log(response.content[0].text);
max_tokens is required — OpenAI defaults it, Anthropic requires itsystem is a top-level param — not a message in the arrayuser — can't start with assistantcontent[0].text not choices[0].message.contenttypescript// OpenAI tool definition { type: 'function', function: { name: 'get_weather', parameters: { ... } } } // Anthropic tool definition { name: 'get_weather', input_schema: { ... } } // Flatter structure
bash# Find all OpenAI imports grep -rn "from 'openai'" --include="*.ts" . grep -rn "import OpenAI" --include="*.ts" . # Find response access patterns to update grep -rn "choices\[0\]" --include="*.ts" . grep -rn "message.content" --include="*.ts" . # May need updating
openai imports replaced with @claude-ai/sdkchoices[0].message.content → content[0].text)system parametermax_tokens added to all API calls (required, not optional)| Error | Cause | Solution | |-------|-------|----------| | API Error | Check error type and status code | See clade-common-errors |
See API Mapping table, Before/After SDK code, Key Differences list, Tool Use Migration, and Grep & Replace commands above.
See clade-sdk-patterns for production Anthropic SDK patterns.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | fail→fail | 17,760 | 16,110 | -9% | 1 | 1 | 0% | 3,473 | 4,382 | +26% | 0 | 0 | — |
case-08 | pass→pass | 10,140 | 6,975 | -31% | 1 | 1 | 0% | 1,833 | 2,447 | +33% | 0 | 0 | — |
case-13 | fail→pass | 10,685 | 2,718 | -75% | 1 | 1 | 0% | 1,904 | 1,541 | -19% | 0 | 0 | — |
case-01 | fail→fail | 15,225 | 13,747 | -10% | 1 | 1 | 0% | 2,934 | 3,893 | +33% | 0 | 0 | — |
case-02 | pass→pass | 2,713 | 3,756 | +38% | 1 | 1 | 0% | 530 | 1,827 | +245% | 0 | 0 | — |
case-03 | pass→pass | 6,801 | 4,667 | -31% | 1 | 1 | 0% | 1,399 | 1,961 | +40% | 0 | 0 | — |
case-19 | fail→pass | 12,362 | 9,739 | -21% | 1 | 1 | 0% | 2,022 | 2,787 | +38% | 0 | 0 | — |
case-04 | pass→pass | 8,955 | 4,269 | -52% | 1 | 1 | 0% | 1,672 | 1,901 | +14% | 0 | 0 | — |
case-05 | pass→pass | 6,816 | 4,204 | -38% | 1 | 1 | 0% | 1,296 | 1,800 | +39% | 0 | 0 | — |
case-06 | pass→pass | 7,153 | 6,329 | -12% | 1 | 1 | 0% | 1,460 | 2,309 | +58% | 0 | 0 | — |
case-07 | pass→pass | 8,810 | 7,308 | -17% | 1 | 1 | 0% | 1,541 | 2,438 | +58% | 0 | 0 | — |
case-09 | fail→pass | 10,143 | 7,172 | -29% | 1 | 1 | 0% | 1,929 | 2,432 | +26% | 0 | 0 | — |
case-10 | pass→pass | 3,613 | 2,295 | -36% | 1 | 1 | 0% | 690 | 1,497 | +117% | 0 | 0 | — |
case-11 | pass→pass | 4,370 | 3,919 | -10% | 1 | 1 | 0% | 669 | 1,773 | +165% | 0 | 0 | — |
case-12 | fail→fail | 7,554 | 2,640 | -65% | 1 | 1 | 0% | 1,330 | 1,443 | +8% | 0 | 0 | — |
case-14 | pass→pass | 5,251 | 3,606 | -31% | 1 | 1 | 0% | 995 | 1,674 | +68% | 0 | 0 | — |
case-15 | pass→pass | 15,687 | 11,465 | -27% | 1 | 1 | 0% | 3,009 | 3,412 | +13% | 0 | 0 | — |
case-16 | pass→pass | 13,506 | 8,466 | -37% | 1 | 1 | 0% | 2,652 | 2,780 | +5% | 0 | 0 | — |
case-17 | pass→pass | 12,204 | 8,304 | -32% | 1 | 1 | 0% | 2,332 | 2,816 | +21% | 0 | 0 | — |
case-18 | pass→pass | 4,289 | 4,914 | +15% | 1 | 1 | 0% | 878 | 2,098 | +139% | 0 | 0 | — |
case-21 | pass→pass | 5,756 | 7,202 | +25% | 1 | 1 | 0% | 953 | 2,374 | +149% | 0 | 0 | — |
case-22 | fail→fail | 10,500 | 9,076 | -14% | 1 | 1 | 0% | 2,187 | 2,922 | +34% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.