🎓 הקורס הדיגיטלי המקיף בישראל ל-Claude — לעבוד חכם יותר עם Claude
פפרומפטים.AIחיפוש
🤖

Skill בנייה עם Anthropic API ל-Claude

מדריך מעשי לפיתוח אפליקציות עם ה-API של Anthropic ומודלי Claude.

anthropic-api-building · v1.0.0💾 5KB · חינם🧩 חלק מחבילת מומחה AI לעסקים
מה זה Skill ואיך מתקינים?

Skill הוא יכולת קבועה ש-Claude טוען אוטומטית כשהיא רלוונטית לבקשה שלך — בניגוד לפרומפט רגיל שצריך להעתיק מחדש בכל שיחה. מתקינים פעם אחת (מעבירים תיקייה אל ~/.claude/skills/ או מעלים דרך הגדרות האפליקציה), ומאז הוא עובד לבד — ללא כל פעולה נוספת.

חדש ל-Claude? התחל כאן ←

⬇️ הורדת ה-Skill (5KB)

ZIP · ללא הרשמה · רישיון שימוש כלול בקובץ

📖 מה ה-Skill הזה כולל

מתי להשתמש

"Anthropic API", "Claude API", "Build with Claude", "API integration".

הוראות עבודה

1. Setup

import anthropic

client = anthropic.Anthropic(api_key="sk-...")

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)
print(response.content[0].text)

2. Models 2026

  • claude-opus-4 — Best, expensive ($15/$75 per 1M).
  • claude-sonnet-4-6 — Balanced ($3/$15).
  • claude-haiku-4-5 — Cheap + fast ($0.25/$1.25).

3. Key Features

System Prompts

response = client.messages.create(
    model="claude-sonnet-4-6",
    system="You are a helpful Hebrew translator.",
    messages=[{"role": "user", "content": "Translate: Hello world"}],
    max_tokens=100
)

Streaming

with client.messages.stream(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Tell me a story"}]
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

Tool Use (Function Calling)

tools = [{
    "name": "get_weather",
    "description": "Get current weather",
    "input_schema": {
        "type": "object",
        "properties": {
            "location": {"type": "string"}
        }
    }
}]

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    tools=tools,
    messages=[{"role": "user", "content": "Weather in Tel Aviv?"}]
)
# Claude responds with tool_use, you execute, send back result

4. Prompt Caching — חיסכון 90%

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    system=[
        {
            "type": "text",
            "text": "[Long system prompt with examples...]",
            "cache_control": {"type": "ephemeral"}
        }
    ],
    messages=[{"role": "user", "content": "Question?"}]
)

Pricing

  • Cache write: 1.25x normal.
  • Cache read: 0.1x normal (10% cost).
  • Lifetime: 5 minutes (refreshed on use).

When

  • Same system prompt across many calls.
  • RAG context reused.
  • Few-shot examples.

5. Batch API — חיסכון 50%

# Submit batch of 10K requests
batch = client.messages.batches.create(
    requests=[
        {"custom_id": "1", "params": {...}},
        {"custom_id": "2", "params": {...}},
        # ... up to 10K
    ]
)
# Process within 24 hours, 50% cost

Use Cases

  • Bulk classification.
  • Mass content generation.
  • Migration / re-processing.

6. Vision

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "image",
                "source": {"type": "base64", "media_type": "image/jpeg", "data": "..."}
            },
            {"type": "text", "text": "Describe this image"}
        ]
    }]
)

7. Best Practices

Performance

  • Stream for UX (perceived speed).
  • Parallel requests where possible.
  • Cache common prompts.
  • Batch for async work.

Cost

  • Use Haiku for 80% of tasks.
  • Limit max_tokens.
  • Prompt caching mandatory.
  • Monitor usage in console.

Reliability

  • Retry logic with exponential backoff.
  • Fallback to cheaper model on errors.
  • Validate output before downstream actions.

Security

  • API keys in env variables, not code.
  • Rate limiting on your end.
  • Don't log sensitive prompts/responses.

8. Error Handling

import anthropic
try:
    response = client.messages.create(...)
except anthropic.RateLimitError:
    # Wait and retry
    pass
except anthropic.APIError as e:
    # Log + alert
    pass

9. SDK Languages

  • Python (official).
  • TypeScript/JavaScript (official).
  • Ruby, Go, Java (community).
  • HTTP REST for any language.

10. Rate Limits

Tier 1 (default)

  • 60 requests/min.
  • 50K input tokens/min.

Higher tiers

  • Apply via console.
  • Up to 4K rpm.

11. Israel Specifics

  • Hebrew prompts native quality.
  • Privacy: Anthropic doesn't train on API data.
  • Pricing: USD (₪3.7-3.8 = $1).

12. אסיים בהמלצה.

פרומפט לדוגמה

Build classifier with Claude API. Python.

Cost optimization for 1M API calls/month.

Tool use for agent. Code example.


© 2026 AI Expert Pro | גרסה 1.0.0

📥 התקנה בחצי דקה

  1. 1. הורד ופתח את קובץ ה-ZIP — תקבל תיקייה בשם anthropic-api-building.
  2. 2. ב-Claude Code: העבר את התיקייה אל ~/.claude/skills/.
    באפליקציה (Claude / Cowork): הגדרות ← Capabilities ← Skills ← העלאה.
  3. 3. בקש מ-Claude את מה שצריך בעברית — הוא יפעיל את ה-skill לבד כשזה רלוונטי.

רוצה skill כזה, אבל מותאם בדיוק לעסק שלך?

בקורס Claude לעסקים תלמד לבנות skills משלך — לתהליכים הספציפיים שלך, בעברית, בלי תלות באף אחד.

לפרטים על לעבוד חכם יותר עם Claude ←

🧩 עוד skills מחבילת מומחה AI לעסקים

📚 פרומפטים באותו תחום

קהילה