理解 Claude 3.5 API:功能、教程和定價

2024-06-21 | Winkykyk

概述

2024年6月21日,Anthropic 發佈了最新的 AI 模型 Claude 3.5 Sonnet。本文提供了 Claude 3.5 的新功能摘要和使用 Claude 3.5 API 的簡易教程。

Claude 3.5 Sonnet 概述

Claude 3.5 Sonnet 是 Anthropic 最新 AI 模型家族的一部分,在多項評估中表現優異,處理速度是 Claude 3 Opus 的兩倍。

Claude 3.5 Sonnet 主要功能

  • 高級智能:擅長研究生水平的推理、本科知識和編程。
  • 高速處理:運行速度是 Claude 3 Opus 的兩倍。
  • 視覺理解:更優越的圖表和圖像解讀能力。
  • 成本效益:中等價格下的高性能。
  • 廣泛可用性:可在 Claude.ai、iOS 應用和 API 上使用。
  • 大上下文窗口:200K 字符的上下文窗口。
  • 安全考慮:經過嚴格測試以減少濫用風險。

使用 Claude 3.5 Sonnet API

  1. 獲取訪問令牌
    • 訪問 Claude 官方網站並點擊「Get API Access」。
sign in claude’s official website for getting the API access
  • 登錄並導航到開發者儀表板。
  • 點擊「Get API Keys」然後「Create Key」以生成 API 令牌,並妥善保管。
Clicking on “Get API Keys” to process
Clicking on “Create Key” to get the Claude API key

使用 Apidog 進行 API 管理

  • 註冊 Apidog 並訪問 Claude 3 API 項目。.
Get access to Claude API document created by Apidog at its API center
  • 選擇所需的端點並使用「Try it out」功能。
Click on “Try it out” to send API request to Claude API
  • 在標頭中輸入訪問令牌,並在請求正文中指定 Claude 3.5 Sonnet。
enter access token to get the response from Claude API
  • 發送請求以獲得來自 Claude 服務器的響應。
Send the request to get response from Claude API

基準比較

Claude 3.5 Sonnet 在多項基準測試中超越了之前的頂級模型 Claude 3 Opus 和 GPT-4o,尤其在研究生級別推理和編程等方面表現突出:

  • 研究生級別推理
  • 編程
  • 綜合評估
  • 數學問題解決

與 GPT-4o 的比較

在與 GPT-4o 的比較中,Claude 3.5 Sonnet 在六個領域中的四個領域中領先,儘管 GPT-4o 在數學問題解決方面表現更為優異。

Comparing Claude 3.5 Sonnet with other language models

Claude 3.5 API 定價

Claude 3.5 Sonnet 的 API 定價為每百萬個輸入令牌 3 美元和每百萬個輸出令牌 15 美元,與之前的 Claude 3 Sonnet 模型相同。這比 Claude 3 Opus 提供了更高的性能和更低的成本。

查看定價頁面了解更多信息。

結論

Claude 3.5 是 AI 技術的重大進步,結合了高級智能和成本效益。API 允許開發者無縫地將這些功能集成到他們的項目中。未來的 Claude 3.5 系列,如 Claude 3.5 Haiku 和 Claude 3.5 Opus,預計將進一步提升這些功能。

資料來源:https://medium.com/@winkykyk/claude-3-5-api-cd9a5c1762cd

Related posts