Apidog

All-in-one Collaborative API Development Platform

API Design

API Documentation

API Debugging

API Mock

API Automated Testing

Sign up for free
Home / Tutorials / Claude 3.5 API: Latest Information and Beginner's Tutorial!

Claude 3.5 API: Latest Information and Beginner's Tutorial!

On June 21, 2024, Anthropic released its latest AI model, Claude 3.5 Sonnet. In this article, we will summarize the latest information about Claude 3.5 and provide an easy-to-understand tutorial on how to use the Claude 3.5 API.

On June 21, 2024, Anthropic released its latest AI model, Claude 3.5 Sonnet. In this article, we will summarize the latest information about Claude 3.5 and provide an easy-to-understand tutorial on how to use the Claude 3.5 API.

💡 Anyone can easily use the Claude 3.5 API using the API management tool Apidog. In Apidog's Claude 3 API project, you can select the endpoint you want to use from the left menu and call it with "Try it out". Enter the access token in the header, specify Claude 3.5 Sonnet as the model in the body, and send the request to get a response.
button

What is Claude 3.5?

Claude 3.5 is the latest AI model family developed by Anthropic. Claude 3.5 Sonnet was announced as the first release in this family.

Introducing Claude 3.5 Sonnet
Introducing Claude 3.5 Sonnet—our most intelligent model yet. Sonnet now outperforms competitor models and Claude 3 Opus on key evaluations, at twice the speed.

The main features of Claude 3.5 Sonnet are as follows:

  • Advanced Intelligence: It has set new industry benchmarks in graduate-level reasoning, undergraduate-level knowledge, and coding abilities.
  • High-Speed Processing: It operates at twice the speed of Claude 3 Opus.
  • Visual Understanding: It demonstrates powerful capabilities in interpreting graphs and images, surpassing Claude 3 Opus in performance.
  • Cost Efficiency: It achieves high performance at mid-tier model pricing.
  • Wide Availability: It's freely available on Claude.ai and iOS app, and can also be accessed via API.
  • Large Context Window: It has a 200K token context window.
  • Safety Considerations: It has undergone rigorous testing and is trained to reduce misuse.

As of June 21, 2024, only Claude 3.5 Sonnet is accessible, but the Claude 3.5 family is expected to release Claude 3.5 Haiku and Claude 3.5 Opus in the future. Anthropic aims to significantly improve the trade-offs between intelligence, speed, and cost every few months.

How to Use Claude 3.5 Sonnet

Since the Claude 3.5 Sonnet model has already been released, it becomes the default model when using Claude. This means that when you open and use Claude as usual, Claude 3.5 Sonnet is being used, which is quite convenient for users.

Claude 3.5 Sonnet as the default model

Understanding the Benefits of Claude 3.5 from Benchmarks

So, what benefits can be gained by upgrading from the previous Claude 3.0 to Claude 3.5? And how does it compare to the recently much-talked-about GPT-4o? In this section, we will try to clarify these issues based on Claude 3.5's benchmarks.

Comparison between Claude 3.0 and Claude 3.5

The previous Claude 3 included three models: Claude 3 Haiku, Claude 3 Sonnet, and Claude 3 Opus. Among these, Opus was the top model with the most outstanding performance, significantly surpassing Sonnet's capabilities. However, upgrading Claude 3.0 Sonnet to Claude 3.5 Sonnet has changed this situation.

According to the benchmarks of Claude 3.5 Sonnet, it outperforms the previous top-tier Claude 3 Opus in all evaluation areas. The abilities being evaluated this time include:

  • Graduate-level reasoning
  • Undergraduate-level knowledge
  • Coding
  • Multilingual mathematics
  • Text-based reasoning
  • Composite evaluation
  • Mathematical problem solving
  • Elementary mathematics

Specifically, in terms of graduate-level reasoning, coding, composite evaluation, and mathematical problem solving, Claude 3.5 Sonnet far exceeds Claude 3 Opus, while in areas such as undergraduate-level knowledge, multilingual mathematics, text-based reasoning, and elementary mathematics, the difference between the two is slight.

Comparison between Claude 3.5 Sonnet and GPT-4o

So how does Claude 3 Opus compare to the recently much-talked-about GPT-4o? Claude 3.5 Sonnet and GPT-4o show differences in the following six areas. Among these, Claude 3.5 Sonnet takes the lead in four areas:

  • Graduate-level reasoning
  • Coding
  • Multilingual mathematics
  • Text-based reasoning

However, GPT-4o significantly leads in mathematical problem solving. In undergraduate-level knowledge (0-shot CoT), Claude 3.5 Sonnet scores 88.3% while GPT-4o scores 88.7%, a slight difference.

Overall, Claude 3.5 Sonnet shows superior performance in more areas than GPT-4o, but GPT-4o demonstrates strength in mathematical problem solving. However, a complete comparison is difficult as data for GPT-4o is missing in some areas.

For specific benchmarks of Claude 3.5 Sonnet, Claude 3 Opus, and GPT-4o, please refer to the following image:

Comparison of Claude 3.5 Sonnet with other models

In addition to Claude 3.5 Sonnet, Claude 3 Opus, and GPT-4o, this image also compares the performance of mainstream artificial intelligence models such as Gemini 1.5 Pro and Llama-400b.

What About the Claude 3.5 API?

With the release of Claude 3.5 Sonnet, the Claude 3.5 API has also become available. This allows developers to access Claude 3.5 services externally using the Claude 3.5 API or incorporate Claude 3.5's capabilities into their own projects. So, how can we use the Claude 3.5 API? Next, we will introduce detailed information about the Claude 3.5 API.

Welcome to Claude - Anthropic
Claude is a highly performant, trustworthy, and intelligent AI platform built by Anthropic. Claude excels at tasks involving language, reasoning, analysis, coding, and more.

Claude 3.5 API Pricing

Currently, in the Claude 3.5 family, only Sonnet has been upgraded to 3.5, so in this section, we will introduce the pricing for the Claude 3.5 Sonnet API.

Pricing
Anthropic is an AI safety and research company that’s working to build reliable, interpretable, and steerable AI systems.

The pricing for Claude 3.5 Sonnet is $3 for input tokens and $15 for output tokens per million tokens. This pricing is exactly the same as Claude 3 Sonnet. Although the performance of Claude 3.5 Sonnet has significantly evolved compared to Claude 3, the usage fee remains unchanged from before.

Claude 3.5 Sonnet pricing

In other words, you can use Claude 3.5 Sonnet, which has much stronger performance, at a much lower price than the expensive Claude 3 Opus.

How to Use Claude 3.5 Sonnet API: Getting Started Easily

So, how can we use the Claude 3.5 Sonnet API? Next, we will explain how to use the Claude 3.5 Sonnet API in an easy-to-understand manner.

Obtaining Access Token for Claude 3.5 Sonnet API

To start using the Claude 3.5 Sonnet API, you first need to obtain an API access token. The process of obtaining a Claude API access token is the same regardless of which Claude model you want to use.

Step 1. Access Claude's official website and click the "Get API Access" button to start obtaining an authentication token.

Obtaining Claude API access key

Step 2. After signing in to your Claude account here, Claude's developer dashboard will be displayed. Click the "Get API Keys" button here.

Click the Get API Keys button

Step 3. Click "Create Key" here to create an authentication token for the Claude 3 API.

Creating API key

Step 4. Then, define a name for this API key yourself, and the authentication key for API usage will be displayed. Copy this API key here and store it safely.

Obtaining and copying API key

Using Claude 3.5 Sonnet API Easily

After obtaining the Claude API access token by following the above steps, you can easily use the Claude 3.5 Sonnet API using the convenient API management tool Apidog introduced in this section.

button

Apidog has a service called API Hub that includes various third-party APIs, so users can immediately access the Claude API project using Apidog, easily use it, test it, generate various client codes, and integrate Claude 3.5 Sonnet into their own projects.

Claude 3 API Project

Accessing Apidog's Claude project

Step 1. Select the endpoint you want to use

After accessing the Claude 3 API project page, select the API you want to use from the left menu, and click the "Try it out" button on the right panel.

Immediately use Claude API with Apidog

Step 2. Enter the API access token

To use the API, you need access rights to the Claude 3.5 Sonnet API. Switch to the Header tab and enter the access token in x-api-key.

Enter key in Header

Note: If you need to use the Claude 3.5 Sonnet API token frequently, you can save the Claude 3 API key as an environment variable. The API token is saved locally, so it will not be synchronized to the server, so don't worry.

OpenAI key environment variable

Step 3. Specify the model as Claude 3.5 Sonnet and make a request

Switch to the Body tab, specify the model, etc., edit the message to be sent, and then click the "Send" button to send the request to Claude's server and receive a response.

Send request specifying Claude 3.5 sonnet

Note: To use the Claude 3.5 Sonnet model, you need to set the model field in the Body JSON data to claude-3-5-sonnet-20240620. The template for JSON data to send a request to the Claude 3.5 Sonnet API is as follows:

{
    "model": "claude-3-5-sonnet-20240620", // Specify the model as Claude 3.5 Sonnet
    "max_tokens": 1024, // Define the maximum number of tokens that can be consumed in this session
    "messages": [
        {"role": "user", "content": "Hello, world"} // Describe the message you want to send to Claude 3.5 Sonnet
    ]
}

Also, if you need to customize the request more freely, you can click the "Run in Apidog" button to call up the API management tool, which makes it more convenient to customize the request as you like, centrally manage the Claude 3.5 Sonnet API and other API endpoints, and perform combined tests with other endpoints.

Introduce Claude 3 API to project
button

Conclusion

On June 21, 2024, Anthropic released its latest AI model family, "Claude 3.5". Claude 3.5 significantly outperforms the previous Claude 3, featuring advanced intelligence, high-speed processing, excellent visual understanding, and good cost efficiency. Claude 3.5 Sonnet, the first release, has demonstrated abilities surpassing Claude 3's top model, Opus, in benchmarks. Furthermore, in comparison with GPT-4o, Claude 3.5 Sonnet outperformed in 4 out of 6 evaluation areas, showing overall superior performance.

With the release of Claude 3.5, the Claude 3.5 API has also been made public. This allows developers to incorporate Claude 3.5's capabilities into their own projects. The pricing remains unchanged from before, offering higher performance at a lower cost than Claude 3 Opus. Using the API management tool Apidog, you can easily call, test, and customize the Claude 3.5 API.

Claude 3.5 represents a new milestone in AI, offering advanced intelligence at a more appropriate price. The future development of the Claude 3.5 family is sure to attract attention.

Join Apidog's Newsletter

Subscribe to stay updated and receive the latest viewpoints anytime.