openai/chatgpt的api接口,各个模型的最大输入token一览表

chatgpt的各个3.5api模型接口的最大输入量一览表:

MODELDESCRIPTIONCONTEXT WINDOWTRAINING DATA
gpt-3.5-turbo-1106Updated GPT 3.5 Turbo

New


The latest GPT-3.5 Turbo model with improved instruction following, JSON mode, reproducible outputs, parallel function calling, and more. Returns a maximum of 4,096 output tokens. 
16,385 tokensUp to Sep 2021
gpt-3.5-turboCurrently points to gpt-3.5-turbo-0613. Will point to gpt-3.5-turbo-1106 starting Dec 11, 2023. 4,096 tokensUp to Sep 2021
gpt-3.5-turbo-16kCurrently points to gpt-3.5-turbo-0613. Will point to gpt-3.5-turbo-1106 starting Dec 11, 2023. 16,385 tokensUp to Sep 2021
gpt-3.5-turbo-instructSimilar capabilities as text-davinci-003 but compatible with legacy Completions endpoint and not Chat Completions.4,096 tokensUp to Sep 2021
gpt-3.5-turbo-0613

Legacy

Snapshot of gpt-3.5-turbo from June 13th 2023. Will be deprecatedon June 13, 2024.4,096 tokensUp to Sep 2021
gpt-3.5-turbo-16k-0613

Legacy

Snapshot of gpt-3.5-16k-turbo from June 13th 2023. Will be deprecated on June 13, 2024.16,385 tokensUp to Sep 2021
gpt-3.5-turbo-0301

Legacy

Snapshot of gpt-3.5-turbo from March 1st 2023. Will be deprecated on June 13th 2024.4,096 tokensUp to Sep 2021
text-davinci-003

Legacy

Can do language tasks with better quality and consistency than the curie, babbage, or ada models. Will be deprecated on Jan 4th 2024.4,096 tokensUp to Jun 2021
text-davinci-002

Legacy

Similar capabilities to text-davinci-003 but trained with supervised fine-tuning instead of reinforcement learning. Will be deprecated on Jan 4th 2024.4,096 tokensUp to Jun 2021
code-davinci-002

Legacy

Optimized for code-completion tasks. Will be deprecated on Jan 4th 2024.8,001 tokensUp to Jun 2021

chatgpt的各个4.0api模型接口的最大输入量一览表:

MODELDESCRIPTIONCONTEXT WINDOWTRAINING DATA
gpt-4-1106-previewGPT-4 Turbo

New


The latest GPT-4 model with improved instruction following, JSON mode, reproducible outputs, parallel function calling, and more. Returns a maximum of 4,096 output tokens. This preview model is not yet suited for production traffic. Learn more.
128,000 tokensUp to Apr 2023
gpt-4-vision-previewGPT-4 Turbo with vision

New


Ability to understand images, in addition to all other GPT-4 Turbo capabilties. Returns a maximum of 4,096 output tokens. This is a preview model version and not suited yet for production traffic. Learn more.
128,000 tokensUp to Apr 2023
gpt-4Currently points to gpt-4-0613. See continuous model upgrades.8,192 tokensUp to Sep 2021
gpt-4-32kCurrently points to gpt-4-32k-0613. See continuous model upgrades.32,768 tokensUp to Sep 2021
gpt-4-0613Snapshot of gpt-4 from June 13th 2023 with improved function calling support.8,192 tokensUp to Sep 2021
gpt-4-32k-0613Snapshot of gpt-4-32k from June 13th 2023 with improved function calling support.32,768 tokensUp to Sep 2021
gpt-4-0314

Legacy

Snapshot of gpt-4 from March 14th 2023 with function calling support. This model version will be deprecated on June 13th 2024.8,192 tokensUp to Sep 2021
gpt-4-32k-0314

Legacy

Snapshot of gpt-4-32k from March 14th 2023 with function calling support. This model version will be deprecated on June 13th 2024.32,768 tokensUp to Sep 2021

 

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
要使用Java调用ChatGPTAPI接口,您需要了解API的细节和Java中的HTTP请求。ChatGPT API可能需要身份验证令牌和请求参数,这也需要在Java代码中进行设置。以下是一个基本的Java代码示例,可以用来调用ChatGPT API: ```java import java.net.HttpURLConnection; import java.net.URL; import java.io.BufferedReader; import java.io.InputStreamReader; public class ChatGPTAPI { public static void main(String[] args) { try { String token = "your_token_here"; // ChatGPT API token String url = "https://api.chatgpt.com/chat"; // ChatGPT API endpoint String params = "message=Hello"; // ChatGPT API request parameters URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); // Set HTTP request method con.setRequestMethod("POST"); // Set HTTP request headers con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); con.setRequestProperty("Authorization", "Bearer " + token); // Set HTTP request body con.setDoOutput(true); con.getOutputStream().write(params.getBytes("UTF-8")); // Send HTTP request and get HTTP response int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); // Print HTTP response System.out.println(response.toString()); } catch (Exception e) { System.out.println(e); } } } ``` 在这个示例中,我们使用Java的HttpURLConnection类来建立与ChatGPT API的HTTP连接,并发送POST请求。我们还设置了HTTP请求头和请求参数。最后,我们打印了HTTP响应。请注意,您需要将`your_token_here`替换为您的ChatGPT API令牌,并将`Hello`替换为您想要发送的消息。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

淘小白_TXB2196

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值