{"id":1325,"date":"2023-02-25T19:20:21","date_gmt":"2023-02-25T11:20:21","guid":{"rendered":"https:\/\/www.aqwu.net\/wp\/?p=1325"},"modified":"2023-02-25T19:20:56","modified_gmt":"2023-02-25T11:20:56","slug":"openai-api-%e6%8c%87%e5%8d%97%ef%bc%9a7-%e9%80%9f%e7%8e%87%e9%99%90%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.aqwu.net\/wp\/?p=1325","title":{"rendered":"OpenAI API \u6307\u5357\uff1a7.\u901f\u7387\u9650\u5236"},"content":{"rendered":"\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/overview\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/overview\">\u6982\u8ff0<\/a><\/h2>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-are-rate-limits\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-are-rate-limits\">\u4ec0\u4e48\u662f\u901f\u7387\u9650\u5236\uff1f<\/a><\/h3>\n\n\n\n<p>\u901f\u7387\u9650\u5236\u662f API \u5bf9\u7528\u6237\u6216\u5ba2\u6237\u7aef\u5728\u6307\u5b9a\u65f6\u95f4\u6bb5\u5185\u53ef\u4ee5\u8bbf\u95ee\u670d\u52a1\u5668\u7684\u6b21\u6570\u65bd\u52a0\u7684\u9650\u5236\u3002<\/p>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/error-mitigation\">Rate Limits &#8211; OpenAI API<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/why-do-we-have-rate-limits\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/why-do-we-have-rate-limits\">\u4e3a\u4ec0\u4e48\u6211\u4eec\u6709\u901f\u7387\u9650\u5236\uff1f<\/a><\/h3>\n\n\n\n<p>\u901f\u7387\u9650\u5236\u662f API \u7684\u5e38\u89c1\u505a\u6cd5\uff0c\u5b9e\u65bd\u901f\u7387\u9650\u5236\u6709\u51e0\u4e2a\u4e0d\u540c\u7684\u539f\u56e0\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5b83\u4eec\u6709\u52a9\u4e8e\u9632\u6b62\u6ee5\u7528\u6216\u8bef\u7528 API\u3002<\/strong>\u4f8b\u5982\uff0c\u6076\u610f\u53c2\u4e0e\u8005\u53ef\u80fd\u4f1a\u7528\u8bf7\u6c42\u6df9\u6ca1 API\uff0c\u8bd5\u56fe\u4f7f\u5176\u8fc7\u8f7d\u6216\u5bfc\u81f4\u670d\u52a1\u4e2d\u65ad\u3002\u901a\u8fc7\u8bbe\u7f6e\u901f\u7387\u9650\u5236\uff0cOpenAI\u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u6d3b\u52a8\u3002<\/li>\n\n\n\n<li><strong>\u901f\u7387\u9650\u5236\u6709\u52a9\u4e8e\u786e\u4fdd\u6bcf\u4e2a\u4eba\u90fd\u53ef\u4ee5\u516c\u5e73\u8bbf\u95ee API\u3002<\/strong>\u5982\u679c\u4e00\u4e2a\u4eba\u6216\u7ec4\u7ec7\u53d1\u51fa\u8fc7\u591a\u7684\u8bf7\u6c42\uff0c\u5219\u53ef\u80fd\u4f1a\u4f7f\u5176\u4ed6\u4eba\u7684API\u9677\u5165\u56f0\u5883\u3002\u901a\u8fc7\u9650\u5236\u5355\u4e2a\u7528\u6237\u53ef\u4ee5\u53d1\u51fa\u7684\u8bf7\u6c42\u6570\u91cf\uff0cOpenAI \u786e\u4fdd\u6700\u591a\u7684\u4eba\u6709\u673a\u4f1a\u4f7f\u7528 API\uff0c\u800c\u4e0d\u4f1a\u9047\u5230\u901f\u5ea6\u53d8\u6162\u7684\u60c5\u51b5\u3002<\/li>\n\n\n\n<li><strong>\u901f\u7387\u9650\u5236\u53ef\u4ee5\u5e2e\u52a9 OpenAI \u7ba1\u7406\u5176\u57fa\u7840\u8bbe\u65bd\u4e0a\u7684\u603b\u8d1f\u8f7d\u3002<\/strong>\u5982\u679c\u5bf9 API \u7684\u8bf7\u6c42\u6025\u5267\u589e\u52a0\uff0c\u5219\u53ef\u80fd\u4f1a\u5bf9\u670d\u52a1\u5668\u9020\u6210\u8d1f\u62c5\u5e76\u5bfc\u81f4\u6027\u80fd\u95ee\u9898\u3002\u901a\u8fc7\u8bbe\u7f6e\u901f\u7387\u9650\u5236\uff0cOpenAI \u53ef\u4ee5\u5e2e\u52a9\u4e3a\u6240\u6709\u7528\u6237\u4fdd\u6301\u6d41\u7545\u4e00\u81f4\u7684\u4f53\u9a8c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8bf7\u5b8c\u6574\u9605\u8bfb\u672c\u6587\u6863\uff0c\u4ee5\u66f4\u597d\u5730\u4e86\u89e3OpenAI\u7684\u9650\u901f\u7cfb\u7edf\u7684\u5de5\u4f5c\u539f\u7406\u3002\u6211\u4eec\u5305\u62ec\u4ee3\u7801\u793a\u4f8b\u548c\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6848\u6765\u5904\u7406\u5e38\u89c1\u95ee\u9898\u3002\u5efa\u8bae\u5728\u586b\u5199<a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSc6gSL3zfHFlL6gNIyUcjkEv29jModHGxg5_XGyr-PrE2LaHw\/viewform\" target=\"_blank\" rel=\"noreferrer noopener\">\u901f\u7387\u9650\u5236\u63d0\u9ad8\u7533\u8bf7\u8868<\/a>\u4e4b\u524d\u9075\u5faa\u672c\u6307\u5357\uff0c\u5e76\u5728\u4e0a\u4e00\u8282\u4e2d\u8be6\u7ec6\u8bf4\u660e\u5982\u4f55\u586b\u5199\u8be5\u8868\u5355\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-are-the-rate-limits-for-our-api\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-are-the-rate-limits-for-our-api\">\u6211\u4eec\u7684 API \u7684\u901f\u7387\u9650\u5236\u662f\u4ec0\u4e48\uff1f<\/a><\/h3>\n\n\n\n<p>\u6211\u4eec\u4f1a\u6839\u636e\u6240\u4f7f\u7528\u7684\u7279\u5b9a\u7ec8\u7aef\u8282\u70b9\u4ee5\u53ca\u60a8\u62e5\u6709\u7684\u5e10\u6237\u7c7b\u578b\uff0c\u5728<a href=\"https:\/\/platform.openai.com\/docs\/guides\/production-best-practices\">\u7ec4\u7ec7\u7ea7\u522b<\/a>\uff08\u800c\u4e0d\u662f\u7528\u6237\u7ea7\u522b\uff09\u5f3a\u5236\u5b9e\u65bd\u901f\u7387\u9650\u5236\u3002\u901f\u7387\u9650\u5236\u4ee5\u4e24\u79cd\u65b9\u5f0f\u5ea6\u91cf\uff1a<strong>RPM<\/strong>\uff08\u6bcf\u5206\u949f\u8bf7\u6c42\u6570\uff09\u548c&nbsp;<strong>TPM<\/strong>\uff08\u6bcf\u5206\u949f\u4ee4\u724c\u6570\uff09\u3002\u4e0b\u8868\u7a81\u51fa\u663e\u793a\u4e86\u6211\u4eec API \u7684\u9ed8\u8ba4\u901f\u7387\u9650\u5236\uff0c\u4f46\u5728\u586b\u5199\u901f\u7387\u9650\u5236\u63d0\u9ad8\u8bf7\u6c42\u8868\u5355\u540e\uff0c\u8fd9\u4e9b\u9650\u5236\u53ef\u80fd\u4f1a\u6839\u636e\u60a8\u7684\u4f7f\u7528\u6848\u4f8b\u589e\u52a0\u3002<\/p>\n\n\n\n<p><strong>TPM<\/strong>\uff08\u6bcf\u5206\u949f\u4ee4\u724c\u6570\uff09\u5355\u4f4d\u56e0\u578b\u53f7\u800c\u5f02\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u7c7b\u578b<\/th><th>1 TPM \u7b49\u4e8e<\/th><\/tr><\/thead><tbody><tr><td>davinci<\/td><td>\u6bcf\u5206\u949f 1 \u4e2atoken<\/td><\/tr><tr><td>curie<\/td><td>\u6bcf\u5206\u949f 25 \u4e2atokens<\/td><\/tr><tr><td>babbage<\/td><td>\u6bcf\u5206\u949f 100 \u4e2atokens<\/td><\/tr><tr><td>ada<\/td><td>\u6bcf\u5206\u949f 200 \u4e2atokens<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u5b9e\u9645\u4e0a\uff0c\u8fd9\u610f\u5473\u7740\u60a8\u6bcf\u5206\u949f\u53ef\u4ee5\u5411\u6a21\u578b\u53d1\u9001\u5927\u7ea6 200 \u500d\u7684\u4ee4\u724c\u3002<code>ada<\/code><code>davinci<\/code><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><\/th><th>\u6587\u672c\u548c\u5d4c\u5165<\/th><th>\u98df\u54c1<\/th><th>\u7f16\u8f91<\/th><th>\u56fe\u50cf<\/th><\/tr><\/thead><tbody><tr><td>\u514d\u8d39\u8bd5\u7528\u7528\u6237<\/td><td>\u202220 RPM<br>\u2022150\uff0c000 TPM<\/td><td>\u202220 RPM<br>\u202240\uff0c000 TPM<\/td><td>\u202220 RPM<br>\u2022150\uff0c000 TPM<\/td><td>50\u5f20\/\u5206\u949f<\/td><\/tr><tr><td>\u5373\u7528\u5373\u4ed8\u7528\u6237\uff08\u524d 48 \u5c0f\u65f6\uff09<\/td><td>\u202260 RPM<br>\u2022250\uff0c000 TPM*<\/td><td>\u202220 RPM<br>\u202240\uff0c000 TPM<\/td><td>\u202220 RPM<br>\u2022150\uff0c000 TPM<\/td><td>50\u5f20\/\u5206\u949f<\/td><\/tr><tr><td>\u5373\u7528\u5373\u4ed8\u7528\u6237\uff0848 \u5c0f\u65f6\u540e\uff09<\/td><td>\u20223\uff0c500 RPM<br>\u2022350\uff0c000 TPM*<\/td><td>\u202220 RPM<br>\u202240\uff0c000 TPM<\/td><td>\u202220 RPM<br>\u2022150\uff0c000 TPM<\/td><td>50\u5f20\/\u5206\u949f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u91cd\u8981\u7684\u662f\u8981\u6ce8\u610f\uff0c\u4efb\u4f55\u4e00\u79cd\u9009\u62e9\u90fd\u53ef\u4ee5\u8fbe\u5230\u901f\u7387\u9650\u5236\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u9996\u5148\u53d1\u751f\u7684\u60c5\u51b5\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u5c06 20 \u4e2a\u8bf7\u6c42\uff08\u53ea\u6709 100 \u4e2a\u4ee4\u724c\uff09\u53d1\u9001\u5230 Codex \u7ec8\u7ed3\u70b9\uff0c\u8fd9\u5c06\u586b\u6ee1\u4f60\u7684\u9650\u5236\uff0c\u5373\u4f7f\u4f60\u672a\u5728\u8fd9 40 \u4e2a\u8bf7\u6c42\u4e2d\u53d1\u9001 20k \u4e2a\u4ee4\u724c\u4e5f\u662f\u5982\u6b64\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/how-do-rate-limits-work\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/how-do-rate-limits-work\">\u901f\u7387\u9650\u5236\u5982\u4f55\u5de5\u4f5c\uff1f<\/a><\/h3>\n\n\n\n<p>\u5982\u679c\u60a8\u7684\u901f\u7387\u9650\u5236\u4e3a\u6bcf\u5206\u949f 60 \u4e2a\u8bf7\u6c42\u548c\u6bcf\u5206\u949f 150k \u4e2a\u4ee4\u724c\uff0c\u5219\u60a8\u5c06\u53d7\u5230\u8fbe\u5230\u8bf7\u6c42\/\u5206\u949f\u4e0a\u9650\u6216\u4ee4\u724c\u7528\u5b8c\u7684\u9650\u5236\uff08\u4ee5\u5148\u53d1\u751f\u8005\u4e3a\u51c6\uff09\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6bcf\u5206\u949f\u7684\u6700\u5927\u8bf7\u6c42\u6570\u4e3a 60\uff0c\u5219\u6bcf\u79d2\u5e94\u8be5\u80fd\u591f\u53d1\u9001 1 \u4e2a\u8bf7\u6c42\u3002\u5982\u679c\u6bcf 1 \u6beb\u79d2\u53d1\u9001 800 \u4e2a\u8bf7\u6c42\uff0c\u4e00\u65e6\u8fbe\u5230\u901f\u7387\u9650\u5236\uff0c\u53ea\u9700\u8ba9\u7a0b\u5e8f\u4f11\u7720 200 \u6beb\u79d2\u5373\u53ef\u518d\u53d1\u9001\u4e00\u4e2a\u8bf7\u6c42\uff0c\u5426\u5219\u540e\u7eed\u8bf7\u6c42\u5c06\u5931\u8d25\u3002\u9ed8\u8ba4\u4e3a 3\uff0c000 \u4e2a\u8bf7\u6c42\/\u5206\u949f\uff0c\u5ba2\u6237\u53ef\u4ee5\u6bcf 1 \u6beb\u79d2\u6216\u6bcf .20 \u79d2\u6709\u6548\u53d1\u9001 02 \u4e2a\u8bf7\u6c42\u3002<code>davinci<\/code><\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-happens-if-i-hit-a-rate-limit-error\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-happens-if-i-hit-a-rate-limit-error\">\u5982\u679c\u6211\u9047\u5230\u901f\u7387\u9650\u5236\u9519\u8bef\u4f1a\u600e\u6837\uff1f<\/a><\/h3>\n\n\n\n<p>\u901f\u7387\u9650\u5236\u9519\u8bef\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u5728\u7ec4\u7ec7\u7ec4\u7ec7 {id} \u4e2d\uff0c\u6bcf\u5206\u949f\u8bf7\u6c42\u6570\u8fbe\u5230\u9ed8\u8ba4\u6587\u672c-davinci-002 \u7684\u901f\u7387\u9650\u5236\u3002 \u9650\u5236\uff1a20.000000 \/ \u5206\u949f\u3002 \u7535\u6d41\uff1a24.000000 \/\u5206\u949f<\/p>\n<\/blockquote>\n\n\n\n<p>\u5982\u679c\u8fbe\u5230\u901f\u7387\u9650\u5236\uff0c\u5219\u8868\u793a\u60a8\u5728\u77ed\u65f6\u95f4\u5185\u53d1\u51fa\u4e86\u592a\u591a\u8bf7\u6c42\uff0c\u5e76\u4e14 API \u62d2\u7edd\u6ee1\u8db3\u8fdb\u4e00\u6b65\u7684\u8bf7\u6c42\uff0c\u76f4\u5230\u7ecf\u8fc7\u6307\u5b9a\u7684\u65f6\u95f4\u91cf\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/rate-limits-vs-max_tokens\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/rate-limits-vs-max_tokens\">\u901f\u7387\u9650\u5236\u4e0e<code>max_tokens<\/code><\/a><\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/platform.openai.com\/docs\/models\/overview\" target=\"_blank\">\u6211\u4eec\u63d0\u4f9b\u7684\u6bcf\u4e2a\u6a21\u578b<\/a>\u90fd\u6709\u6709\u9650\u6570\u91cf\u7684tokens\uff0c\u53ef\u4ee5\u5728\u53d1\u51fa\u8bf7\u6c42\u65f6\u4f5c\u4e3a\u8f93\u5165\u4f20\u5165\u3002\u4e0d\u80fd\u589e\u52a0\u6a21\u578b\u63a5\u6536\u7684\u6700\u5927tokens\u6570\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528 <code>text-ada-001<\/code>\uff0c\u5219\u6bcf\u4e2a\u8bf7\u6c42\u53ef\u4ee5\u53d1\u9001\u5230\u6b64\u6a21\u578b\u7684\u6700\u5927\u4ee4\u724c\u6570\u4e3a 2\uff0c048 \u4e2a tokens\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/error-mitigation\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/error-mitigation\">\u9519\u8bef\u7f13\u89e3<\/a><\/h2>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-are-some-steps-i-can-take-to-mitigate-this\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/what-are-some-steps-i-can-take-to-mitigate-this\">\u6211\u53ef\u4ee5\u91c7\u53d6\u54ea\u4e9b\u6b65\u9aa4\u6765\u7f13\u89e3\u8fd9\u79cd\u60c5\u51b5\uff1f<\/a><\/h3>\n\n\n\n<p>OpenAI Cookbook\u6709\u4e00\u4e2a<a href=\"https:\/\/github.com\/openai\/openai-cookbook\/blob\/main\/examples\/How_to_handle_rate_limits.ipynb\" target=\"_blank\" rel=\"noreferrer noopener\">python\u7b14\u8bb0\u672c<\/a>\uff0c\u89e3\u91ca\u4e86\u5982\u4f55\u907f\u514d\u901f\u7387\u9650\u5236\u9519\u8bef\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>\u5728\u63d0\u4f9b\u7f16\u7a0b\u8bbf\u95ee\u3001\u6279\u91cf\u5904\u7406\u529f\u80fd\u548c\u81ea\u52a8\u793e\u4ea4\u5a92\u4f53\u53d1\u5e03\u65f6\uff0c\u8fd8\u5e94\u8c28\u614e\u884c\u4e8b &#8211; \u8bf7\u8003\u8651\u4ec5\u4e3a\u53d7\u4fe1\u4efb\u7684\u5ba2\u6237\u542f\u7528\u8fd9\u4e9b\u529f\u80fd\u3002<\/p>\n\n\n\n<p>\u82e5\u8981\u9632\u6b62\u81ea\u52a8\u548c\u5927\u91cf\u6ee5\u7528\uff0c\u8bf7\u5728\u6307\u5b9a\u65f6\u95f4\u8303\u56f4\uff08\u6bcf\u5929\u3001\u6bcf\u5468\u6216\u6bcf\u6708\uff09\u5185\u4e3a\u5355\u4e2a\u7528\u6237\u8bbe\u7f6e\u4f7f\u7528\u9650\u5236\u3002\u8bf7\u8003\u8651\u4e3a\u8d85\u51fa\u9650\u5236\u7684\u7528\u6237\u5b9e\u65bd\u786c\u4e0a\u9650\u6216\u624b\u52a8\u5ba1\u6838\u6d41\u7a0b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/retrying-with-exponential-backoff\"><\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/retrying-with-exponential-backoff\">\u4f7f\u7528\u6307\u6570\u9000\u907f\u91cd\u8bd5<\/a><\/h4>\n\n\n\n<p>\u907f\u514d\u901f\u7387\u9650\u5236\u9519\u8bef\u7684\u4e00\u79cd\u7b80\u5355\u65b9\u6cd5\u662f\u4f7f\u7528\u968f\u673a\u6307\u6570\u9000\u907f\u81ea\u52a8\u91cd\u8bd5\u8bf7\u6c42\u3002\u4f7f\u7528\u6307\u6570\u9000\u907f\u91cd\u8bd5\u610f\u5473\u7740\u5728\u8fbe\u5230\u901f\u7387\u9650\u5236\u9519\u8bef\u65f6\u6267\u884c\u77ed\u6682\u7761\u7720\uff0c\u7136\u540e\u91cd\u8bd5\u4e0d\u6210\u529f\u7684\u8bf7\u6c42\u3002\u5982\u679c\u8bf7\u6c42\u4ecd\u7136\u4e0d\u6210\u529f\uff0c\u5219\u589e\u52a0\u7761\u7720\u957f\u5ea6\u5e76\u91cd\u590d\u8be5\u8fc7\u7a0b\u3002\u8fd9\u4e00\u76f4\u6301\u7eed\u5230\u8bf7\u6c42\u6210\u529f\u6216\u8fbe\u5230\u6700\u5927\u91cd\u8bd5\u6b21\u6570\u3002 \u8fd9\u79cd\u65b9\u6cd5\u6709\u5f88\u591a\u597d\u5904\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u81ea\u52a8\u91cd\u8bd5\u610f\u5473\u7740\u60a8\u53ef\u4ee5\u4ece\u901f\u7387\u9650\u5236\u9519\u8bef\u4e2d\u6062\u590d\uff0c\u800c\u4e0d\u4f1a\u5d29\u6e83\u6216\u4e22\u5931\u6570\u636e<\/li>\n\n\n\n<li>\u6307\u6570\u9000\u907f\u610f\u5473\u7740\u53ef\u4ee5\u5feb\u901f\u5c1d\u8bd5\u9996\u6b21\u91cd\u8bd5\uff0c\u540c\u65f6\u5728\u524d\u51e0\u6b21\u91cd\u8bd5\u5931\u8d25\u65f6\u4ecd\u53d7\u76ca\u4e8e\u66f4\u957f\u7684\u5ef6\u8fdf<\/li>\n\n\n\n<li>\u5c06\u968f\u673a\u6296\u52a8\u6dfb\u52a0\u5230\u5ef6\u8fdf\u6709\u52a9\u4e8e\u540c\u65f6\u91cd\u8bd5\u6240\u6709\u547d\u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u4e0d\u6210\u529f\u7684\u8bf7\u6c42\u4f1a\u589e\u52a0\u6bcf\u5206\u949f\u6570\u9650\u5236\uff0c\u56e0\u6b64\u8fde\u7eed\u91cd\u65b0\u53d1\u9001\u8bf7\u6c42\u5c06\u4e0d\u8d77\u4f5c\u7528\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e9b\u4f7f\u7528\u6307\u6570\u9000\u907f\u7684&nbsp;<strong>Python \u89e3\u51b3\u65b9\u6848<\/strong>\u793a\u4f8b\u3002<\/p>\n\n\n\n<p>\u793a\u4f8b #1\uff1a\u4f7f\u7528 Tenacity \u5e93<\/p>\n\n\n\n<p>\u793a\u4f8b #2\uff1a\u4f7f\u7528\u9000\u907f\u5e93<\/p>\n\n\n\n<p>\u793a\u4f8b 3\uff1a\u624b\u52a8\u9000\u907f\u5b9e\u73b0<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/batching-requests\"><\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/batching-requests\">\u6279\u5904\u7406\u8bf7\u6c42<\/a><\/h4>\n\n\n\n<p>OpenAI API \u5bf9\u6bcf\u5206\u949f\u8bf7\u6c42\u6570\u548c\u6bcf\u5206\u949f\u4ee4\u724c\u6570\u6709\u5355\u72ec\u7684\u9650\u5236\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u8fbe\u5230\u6bcf\u5206\u949f\u8bf7\u6c42\u6570\u7684\u9650\u5236\uff0c\u4f46\u6bcf\u5206\u949f\u4ee4\u724c\u5177\u6709\u53ef\u7528\u5bb9\u91cf\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u5c06\u591a\u4e2a\u4efb\u52a1\u6279\u5904\u7406\u5230\u6bcf\u4e2a\u8bf7\u6c42\u4e2d\u6765\u63d0\u9ad8\u541e\u5410\u91cf\u3002\u8fd9\u5c06\u5141\u8bb8\u60a8\u6bcf\u5206\u949f\u5904\u7406\u66f4\u591a\u4ee3\u5e01\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u6211\u4eec\u8f83\u5c0f\u7684\u578b\u53f7\u3002<\/p>\n\n\n\n<p>\u53d1\u9001\u4e00\u6279\u63d0\u793a\u7684\u5de5\u4f5c\u65b9\u5f0f\u4e0e\u666e\u901a API \u8c03\u7528\u5b8c\u5168\u76f8\u540c\uff0c\u53ea\u662f\u60a8\u5c06\u5b57\u7b26\u4e32\u5217\u8868\u4f20\u9012\u7ed9\u63d0\u793a\u53c2\u6570\u800c\u4e0d\u662f\u5355\u4e2a\u5b57\u7b26\u4e32\u3002<\/p>\n\n\n\n<p>\u65e0\u6279\u5904\u7406\u7684\u793a\u4f8b<\/p>\n\n\n\n<p>\u6279\u5904\u7406\u793a\u4f8b<\/p>\n\n\n\n<p>\u8b66\u544a\uff1a\u54cd\u5e94\u5bf9\u8c61\u53ef\u80fd\u4e0d\u4f1a\u6309\u63d0\u793a\u987a\u5e8f\u8fd4\u56de\u5b8c\u6210\uff0c\u56e0\u6b64\u8bf7\u59cb\u7ec8\u8bb0\u4f4f\u4f7f\u7528\u7d22\u5f15\u5b57\u6bb5\u5c06\u54cd\u5e94\u5339\u914d\u56de\u63d0\u793a\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/request-increase\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/request-increase\">\u8bf7\u6c42\u589e\u52a0<\/a><\/h2>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/when-should-i-consider-applying-for-a-rate-limit-increase\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/when-should-i-consider-applying-for-a-rate-limit-increase\">\u6211\u5e94\u8be5\u8003\u8651\u4f55\u65f6\u7533\u8bf7\u63d0\u9ad8\u9650\u4ef7\uff1f<\/a><\/h3>\n\n\n\n<p>\u6211\u4eec\u7684\u9ed8\u8ba4\u901f\u7387\u9650\u5236\u6709\u52a9\u4e8e\u6211\u4eec\u6700\u5927\u9650\u5ea6\u5730\u63d0\u9ad8\u7a33\u5b9a\u6027\u5e76\u9632\u6b62\u6ee5\u7528\u6211\u4eec\u7684 API\u3002\u6211\u4eec\u63d0\u9ad8\u9650\u5236\u4ee5\u542f\u7528\u9ad8\u6d41\u91cf\u5e94\u7528\u7a0b\u5e8f\uff0c\u56e0\u6b64\u7533\u8bf7\u63d0\u9ad8\u901f\u7387\u9650\u5236\u7684\u6700\u4f73\u65f6\u673a\u662f\u5f53\u60a8\u8ba4\u4e3a\u60a8\u62e5\u6709\u5fc5\u8981\u7684\u6d41\u91cf\u6570\u636e\u6765\u652f\u6301\u63d0\u9ad8\u901f\u7387\u9650\u5236\u7684\u6709\u529b\u7406\u7531\u65f6\u3002\u6ca1\u6709\u652f\u6301\u6570\u636e\u7684\u5927\u91cf\u901f\u7387\u9650\u5236\u63d0\u9ad8\u8bf7\u6c42\u4e0d\u592a\u53ef\u80fd\u83b7\u5f97\u6279\u51c6\u3002\u5982\u679c\u60a8\u6b63\u5728\u4e3a\u4ea7\u54c1\u53d1\u5e03\u505a\u51c6\u5907\uff0c\u8bf7\u901a\u8fc7 10 \u5929\u5185\u7684\u5206\u9636\u6bb5\u53d1\u5e03\u83b7\u53d6\u76f8\u5173\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u8bf7\u8bb0\u4f4f\uff0c\u63d0\u9ad8\u901f\u7387\u9650\u5236\u6709\u65f6\u53ef\u80fd\u9700\u8981 7-10 \u5929\uff0c\u56e0\u6b64\uff0c\u5982\u679c\u6709\u6570\u636e\u652f\u6301\u60a8\u5c06\u8fbe\u5230\u5f53\u524d\u589e\u957f\u6570\u5b57\uff0c\u8bf7\u5c1d\u8bd5\u63d0\u524d\u8ba1\u5212\u5e76\u5c3d\u65e9\u63d0\u4ea4\u662f\u6709\u610f\u4e49\u7684\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/will-my-rate-limit-increase-request-be-rejected\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/will-my-rate-limit-increase-request-be-rejected\">\u6211\u7684\u901f\u7387\u9650\u5236\u63d0\u9ad8\u8bf7\u6c42\u4f1a\u88ab\u62d2\u7edd\u5417\uff1f<\/a><\/h3>\n\n\n\n<p>\u901f\u7387\u9650\u5236\u63d0\u9ad8\u8bf7\u6c42\u6700\u5e38\u88ab\u62d2\u7edd\uff0c\u56e0\u4e3a\u5b83\u7f3a\u4e4f\u8bc1\u660e\u63d0\u9ad8\u8bf7\u6c42\u6240\u9700\u7684\u6570\u636e\u3002\u6211\u4eec\u5728\u4e0b\u9762\u63d0\u4f9b\u4e86\u6570\u503c\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u6700\u597d\u5730\u652f\u6301\u901f\u7387\u9650\u5236\u63d0\u9ad8\u8bf7\u6c42\uff0c\u5e76\u5c3d\u529b\u6279\u51c6\u7b26\u5408\u6211\u4eec\u5b89\u5168\u653f\u7b56\u7684\u6240\u6709\u8bf7\u6c42\u5e76\u663e\u793a\u652f\u6301\u6570\u636e\u3002\u6211\u4eec\u81f4\u529b\u4e8e\u4f7f\u5f00\u53d1\u4eba\u5458\u80fd\u591f\u4f7f\u7528\u6211\u4eec\u7684 API \u8fdb\u884c\u6269\u5c55\u5e76\u53d6\u5f97\u6210\u529f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/i-ve-implemented-exponential-backoff-for-my-text-code-apis-but-i-m-still-hitting-this-error-how-do-i-increase-my-rate-limit\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/platform.openai.com\/docs\/guides\/rate-limits\/i-ve-implemented-exponential-backoff-for-my-text-code-apis-but-i-m-still-hitting-this-error-how-do-i-increase-my-rate-limit\">\u6211\u5df2\u7ecf\u4e3a\u6211\u7684\u6587\u672c\/\u4ee3\u7801 API \u5b9e\u73b0\u4e86\u6307\u6570\u9000\u907f\uff0c\u4f46\u6211\u4ecd\u7136\u9047\u5230\u6b64\u9519\u8bef\u3002\u5982\u4f55\u63d0\u9ad8\u901f\u7387\u9650\u5236\uff1f<\/a><\/h3>\n\n\n\n<p>\u76ee\u524d\uff0c\u6211\u4eec\u4e0d\u652f\u6301\u589e\u52a0<strong>\u514d\u8d39\u7684 Beta \u7248\u7ec8\u7aef\u8282\u70b9\uff0c\u4f8b\u5982\u7f16\u8f91\u7ec8\u7aef\u8282\u70b9<\/strong>\u3002\u6211\u4eec\u4e5f\u4e0d\u4f1a\u589e\u52a0 ChatGPT \u901f\u7387\u9650\u5236\uff0c\u4f46\u60a8\u53ef\u4ee5\u52a0\u5165&nbsp;<a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSfCVqahRmA5OxQXbRlnSm531fTd8QBdUCwZag7mI9mrlOOIaw\/viewform\" target=\"_blank\" rel=\"noreferrer noopener\">ChatGPT \u4e13\u4e1a\u7248\u8bbf\u95ee\u6743\u9650<\/a>\u7684\u5019\u8865\u540d\u5355\u3002<strong><\/strong><\/p>\n\n\n\n<p>\u6211\u4eec\u7406\u89e3\u6709\u9650\u7684\u901f\u7387\u9650\u5236\u53ef\u80fd\u9020\u6210\u7684\u632b\u8d25\u611f\uff0c\u6211\u4eec\u5f88\u4e50\u610f\u4e3a\u6bcf\u4e2a\u4eba\u63d0\u9ad8\u9ed8\u8ba4\u503c\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u5171\u4eab\u5bb9\u91cf\u9650\u5236\uff0c\u6211\u4eec\u53ea\u80fd\u6279\u51c6\u901a\u8fc7\u6211\u4eec\u7684\u901f\u7387\u9650\u5236\u63d0\u9ad8\u7533\u8bf7\u8868\u8bc1\u660e\u6709\u9700\u6c42\u7684\u4ed8\u8d39\u5ba2\u6237<a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSc6gSL3zfHFlL6gNIyUcjkEv29jModHGxg5_XGyr-PrE2LaHw\/viewform\" target=\"_blank\" rel=\"noreferrer noopener\">\u63d0\u9ad8\u901f\u7387<\/a>\u9650\u5236\u3002 \u4e3a\u4e86\u5e2e\u52a9\u6211\u4eec\u6b63\u786e\u8bc4\u4f30\u60a8\u7684\u9700\u6c42\uff0c\u6211\u4eec\u8981\u6c42\u60a8\u5728\u8868\u5355\u7684\u201c\u5206\u4eab\u9700\u6c42\u8bc1\u636e\u201d\u90e8\u5206\u4e2d\u63d0\u4f9b\u60a8\u5f53\u524d\u4f7f\u7528\u60c5\u51b5\u7684\u7edf\u8ba1\u6570\u636e\u6216\u57fa\u4e8e\u5386\u53f2\u7528\u6237\u6d3b\u52a8\u7684\u9884\u6d4b\u3002\u5982\u679c\u6b64\u4fe1\u606f\u4e0d\u53ef\u7528\uff0c\u6211\u4eec\u5efa\u8bae\u91c7\u7528\u5206\u9636\u6bb5\u53d1\u5e03\u65b9\u6cd5\u3002\u9996\u5148\uff0c\u4ee5\u5f53\u524d\u901f\u7387\u9650\u5236\u5411\u4e00\u90e8\u5206\u7528\u6237\u53d1\u5e03\u670d\u52a1\uff0c\u6536\u96c6 10 \u4e2a\u5de5\u4f5c\u65e5\u7684\u4f7f\u7528\u60c5\u51b5\u6570\u636e\uff0c\u7136\u540e\u6839\u636e\u8be5\u6570\u636e\u63d0\u4ea4\u6b63\u5f0f\u7684\u901f\u7387\u9650\u5236\u63d0\u9ad8\u8bf7\u6c42\uff0c\u4ee5\u4f9b\u6211\u4eec\u5ba1\u6838\u548c\u6279\u51c6\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u5c06\u5ba1\u6838\u60a8\u7684\u8bf7\u6c42\uff0c\u5982\u679c\u83b7\u5f97\u6279\u51c6\uff0c\u6211\u4eec\u5c06\u5728 7-10 \u4e2a\u5de5\u4f5c\u65e5\u5185\u901a\u77e5\u60a8\u6279\u51c6\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u60a8\u5982\u4f55\u586b\u5199\u6b64\u8868\u5355\u7684\u4e00\u4e9b\u793a\u4f8b\uff1a<\/p>\n\n\n\n<p>DALL-E API \u793a\u4f8b<\/p>\n\n\n\n<p>\u8bed\u8a00\u6a21\u578b\u793a\u4f8b<\/p>\n\n\n\n<p>\u4ee3\u7801\u6a21\u578b\u793a\u4f8b<br>\u8bf7\u6ce8\u610f\uff0c\u8fd9\u4e9b\u793a\u4f8b\u53ea\u662f\u4e00\u822c\u7528\u4f8b\u573a\u666f\uff0c\u5b9e\u9645\u4f7f\u7528\u7387\u4f1a\u6839\u636e\u5177\u4f53\u7684\u5b9e\u73b0\u548c\u4f7f\u7528\u60c5\u51b5\u800c\u6709\u6240\u4e0d\u540c\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 \u4ec0\u4e48\u662f\u901f\u7387\u9650\u5236\uff1f \u901f\u7387\u9650\u5236\u662f API \u5bf9\u7528\u6237\u6216\u5ba2\u6237\u7aef\u5728\u6307\u5b9a\u65f6\u95f4\u6bb5\u5185\u53ef\u4ee5\u8bbf\u95ee\u670d\u52a1\u5668\u7684\u6b21\u6570\u65bd\u52a0\u7684\u9650\u5236\u3002 \u539f\u6587 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[289,312,43],"tags":[242,314],"class_list":["post-1325","post","type-post","status-publish","format-standard","hentry","category-gpt","category-openai","category-infoarticle","tag-chatgpt","tag-openai-api"],"views":1740,"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1325"}],"version-history":[{"count":2,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1325\/revisions"}],"predecessor-version":[{"id":1327,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1325\/revisions\/1327"}],"wp:attachment":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}