type
status
slug
summary
date
tags
category
password
Text
AI summary
AI custom autofill
Multi-select
Status
URL
hashtag
勘误
标签
标题
类型
贴文
🪄
icon
本文介绍了如何申请和使用 Azure OpenAI API。由于 OpenAI 的风控,OpenAI 的 API 支付成了很多小伙伴的一大头疼的事情。最近发现微软自家 Azure 上推出了 OpenAI 的服务,国内的信用卡,手机号,IP 都可以使用,少很多折腾,真是完美替代。如果您也想尝试使用 Azure OpenAI API,可以根据以下步骤进行申请和配置。
由于 OpenAI 的风控,OpenAI 的 API 支付成了很多小伙伴的一大头疼的事情。最近发现微软自家 Azure 上推出了 OpenAI 的服务,国内的信用卡,手机号,IP 都可以使用,少很多折腾,真是完美替代。这篇文章分享一下申请到使用的全过程。
价格对比
先来看看价格, Azure 的价格和 OpenAI 直接提供的是一样的,毕竟是一家的~
Model/Service | OpenAI API Pricingper 1,000 tokens | Azure OpenAI API East US Pricingper 1,000 tokens |
GPT-4 Prompt (8K context) | $0.03 | $0.03 |
GPT-4 Completion (8K context) | $0.06 | $0.06 |
GPT-4 Prompt (32K context) | $0.06 | $0.06 |
GPT-4 Completion (32K context) | $0.12 | $0.12 |
ChatGPT (gpt-3.5-turbo) | $0.002 | $0.002 |
Text-Ada | $0.0004 | $0.0004 |
Text-Babbage | $0.0005 | $0.0005 |
Text-Curie | $0.002 | $0.002 |
Text-Davinci | $0.02 | $0.02 |
Code-Cushman | - | $0.024 |
Code-Davinci | - | $0.10 |
准备工作
- 拥有一个微软账户,没有就去申请一个;
- Visa/Master 的信用卡或借记卡 (虚拟卡也可以);
- 公司邮箱 / 学校教育邮箱(公司邮箱就用公司的身份申请 / 学校的教育邮箱就用学生身份申请)。
Azure 注册
微软的账户注册好了,就可以到 Azure[国际版] 注册了,地址 signup.azure.com。
一开始会创建一个免费的账号,需要补充一些信息。
- 地区和 Visa/Master 卡的地区一样就好了;
- 姓名无所谓;
- 邮箱和电话填正确了,电话会发验证码或语音验证(注册的邮箱不需要和申请的公司邮箱一致);
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9725f443-2686-4c04-b0d3-6e2a95122d9b%2Fab660264-7eb7-43ab-b696-ccb116f854ff.png?table=block&id=ca67a2e9-13c3-493a-9bc1-a1a0f3b80490)
- 地址写个存在的,会验证;
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe5b50866-6831-42f8-967c-f65414f81fa1%2F2a829152-6db4-4452-bb58-3dac13772e96.png?table=block&id=e2300f2c-869a-47c3-9b26-cbe57012fd44)
- 信用卡地区是不能切换的,用这个地区的卡就好。(我用 OneKey 的 HK 虚拟卡也成功绑定了);
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0e995b4a-f962-4673-be32-0a5339b62da3%2F1122b6d4-9e77-4c4d-b9ae-0becd4eb3fb8.png?table=block&id=5ac6bb76-a564-4ef8-b4d7-6942158cee77)
- 看到下面的说明账号已经成功注册了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbbe42faf-13f0-4dad-85e3-a47348c0aa1f%2F6657c198-9f4a-41ad-a740-a742480be8a2.png?table=block&id=0a846b25-21ad-4ccc-8733-19cd82054045)
按量订阅 / 学生订阅
注册成功后,点击 Home 进入首页。通过订阅可以看到订阅的 ID,目前我还没尝试过使用免费的订阅 ID 申请,不知道是否能申请下来。
使用教育或者
Pay-As-You-Go
的都是有成功用例的。接下来我就将免费的订阅升级到按量付费。- 在页面上往下拖,找到订阅 (Subscriptions);
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd0f64af2-a73a-4182-8498-e20ac4e43f23%2F018454bc-8e69-4c2b-bcbe-e113fd943368.png?table=block&id=7467fa9b-0488-4623-a489-890f46c82465)
- 可以看到我们当前免费订阅。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5940c005-3676-4acb-88f8-e62fde74fc5c%2F9d96f994-046a-4fe6-a6bc-788e7c7868b4.png?table=block&id=ad2ceda0-4dd5-43fa-be30-d39fa8377d93)
- 点击添加 Add,在选择升级
Pay-As-You-Go
或者Azure for Student
, 我没有学生邮箱就使用了Pay-As-You-Go
的订阅。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5a658530-cefd-4f32-98ad-9f809eae5eb2%2F47cd8880-d382-404b-ad17-dbf5084e1ae3.png?table=block&id=11c84da9-502b-4d33-a608-228c95f41139)
- 选择 Basic, 然后升级。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2328dd5d-cfb7-4ad1-b038-4bb205ed2fb6%2Fccb11c28-0d6a-4a4f-97ad-66881ddd7ec1.png?table=block&id=9d434840-d84e-4456-9858-ba0ce4f28fa0)
- 然后我们就可以看到一会申请 OpenAI 需要受用的订阅 ID 了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4b3a79ce-8112-4964-a97f-c0380b5043c0%2F89f36350-c910-4f5c-82d8-2a1acbb16555.png?table=block&id=3d1c40d2-0a93-4d30-a701-3752e62157b9)
申请 OpenAI
OpenAPI 申请地址 -> aka.ms/oai/access 。
总共有约 25 个选项。其中公司的信息如实填写,成功申请的概率比较大。
- 1,2 姓名问题不大
- 3 订阅 ID 的数量,如果你希望在多个订阅下用就选择多个。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F96287116-e9f8-4dab-9ea5-81a64d4df86d%2F91f8d743-118e-409d-b627-1871a3adc776.png?table=block&id=c3d98c15-2f60-4918-a0b1-b8dd09ae2411)
- 把订阅 ID 复制过来就好。如果选择了多个会出现多个订阅 ID,分别填上就好。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F59819f84-72e7-4f19-a9d6-e99cb3bd856a%2F571b1b7c-6f97-4b3c-a0ed-4b42369b3ca4.png?table=block&id=76f4d8cf-378b-4d39-9d1e-15a76ca85a65)
- 接下来就是公司地址了和邮箱相关的信息了,如实的添加。如果最后通过了,通过的消息也会发送了这个邮箱。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcacdd22c-a43f-42d5-b15b-4d601ebab69f%2Fc77c8cc9-f716-40d4-b8c3-fa760cc4fcc1.png?table=block&id=e8615774-d58b-4cef-9e81-af4e4523a750)
- 公司的地址,官网,如实填写就好。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd42f87bf-4cb4-4022-86b2-7787313484c4%2F68298d96-f367-4286-b557-a1487bb0ade0.png?table=block&id=5ca18d47-8207-4c27-a185-b03a9a36990a)
- 公司电话,服务类型,规模啥的。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F29323fb2-999d-4127-8710-cd92acd4db3f%2Ff31b06c3-4b35-4f9d-86fc-3939ebb7a136.png?table=block&id=2211c474-c56d-46cb-beb0-ef62af67f474)
- 业务类型,行业。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F552ce729-c454-4bf8-8687-7115fd8f050c%2F4d06dd7b-c6ac-466b-a0d4-b2f74a3d61d5.png?table=block&id=826c2271-0eea-4dbf-ad09-daf49a0f0c2e)
- 可选的可以不填
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4e31073a-4df6-42e4-8e4b-3c5b511d18af%2F26b8b859-f6ac-475e-8766-938434ba4587.png?table=block&id=314105f2-7459-4339-8390-c1d89bfef52f)
- 服务的地区,随便选选; 模型可以都勾上。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F08cf433d-88e9-4935-82c1-bb13179013c4%2F00c832ba-01b3-4da0-9b02-f1572ea807a9.png?table=block&id=a4664e0c-5c65-4832-9e6a-c32137fd4d86)
- 后面几个接受一下就好了,然后就可以提交了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F24e9fb4a-95c0-4d0b-8107-b5cdcc06d07c%2F7f4558bd-a28f-4b0b-81cb-1c68f51832c7.png?table=block&id=d32f2b4d-5607-42b7-a7ce-8f3e213b5353)
- 这就提交好了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcd2b6df9-fb10-443e-9e43-9096c3da9c22%2Fca84dad9-f898-4626-b2d3-c255ec2a67a7.png?table=block&id=5e28f355-a8fb-4a04-850c-9929e876ea85)
申请通过
我是过了两天,在公司的邮箱中收到了下面的邮箱,这表示通过了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1a20d0d4-023e-4516-863a-b8e02c068cf4%2Fd00b3cd5-5ab0-452c-be81-71fc05ed57f8.png?table=block&id=96e5e0a2-7c63-42b9-aa3a-8b7684e14a3b)
配置 OpenAI
通过后就可以到 Azure 去配置了。
- 添加资源的时候,搜索 OpenAi 就能找到了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1f2be1e4-c979-45b2-977a-272d67773396%2F24ae33f1-944e-4723-aef8-cd51475c2ac9.png?table=block&id=b75ebca6-42b0-4128-a33e-0a6b212c4b57)
- 创建也很方便,选择订阅,创建个资源组,地区,加个名字就可以使用了,然后网络选全部,Tag 不用管,就成功了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F719e4efc-0e26-4ab8-a8c2-8a84ab503d45%2F448d6d73-8285-4950-b1cf-39be90c4e8a1.png?table=block&id=09ed74e4-2256-48b1-bc63-81c8d9c9c37a)
- 创建后等待一会就部署完成了,然后
Go to resource
就可以进去配置了。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3a09c711-5680-4ddd-9e50-901f83dc1f6d%2F226fdc89-8aa3-4161-b04a-b083cc46c993.png?table=block&id=53f319d1-5285-4986-8b38-79e5d8e2ba6c)
- 接下来,到
Azure AI Studio
页面,Deployments
中创建一个Deployments
。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb505b329-f095-4e24-b24e-8e68c8d32102%2F15445ee2-378e-457c-ab74-fd4688159838.png?table=block&id=ead21f51-5d25-4ade-ab7f-6a3ef78af6f9)
- 创建资源的时候,选择好需要的模型,输入名称即可。(如果你想在一些第三方的 APP 中用,如 OpenCat, 可以按照 App 要求填写)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa686ba16-a264-4d5a-a2a0-684fc7ed6767%2F250d8f58-488e-40d8-b703-1d7a23683bea.png?table=block&id=9cc2845c-61b1-4f41-b510-01a0f8a06f5e)
- API Key 和 API 地址可以在
Overview
页面查看。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0dcef94a-a603-44f0-957c-1561d9412ade%2F467a773b-e9d5-4a3c-a32e-b0eead387175.png?table=block&id=a9c29286-6bb1-4be4-b01c-bb0f615a7069)
这样我们就可以愉快的使用起来啦。
Azure AI Studio
中还可以测试训练数据集,可以聊天,查看简单的实例代码等等。申请 GPT4
上面开通的都只能用 3.5 的模型,GPT4 需要额外的申请,申请地址 aka.ms/oai/get-gpt4 。
- 要先通过上面的申请,不然是不让继续的。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F48d76c72-65d0-446e-9770-fc875b02fa7e%2F4ed023a3-84ed-4802-9ad5-023a6c9c5618.png?table=block&id=10f3eff4-6181-4262-8207-054f5c7ff58f)
- ApplicationID 在通过审核的那封邮件中,标题中就有。
- 订阅 ID,申请时用的那个,多个的话就填第一个。
- 公司邮箱,名字如实填写就好。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcb9c4356-e23e-4401-b1e7-59a0074f8f56%2F478442a1-27b5-4bb5-84ae-dda38fc04eda.png?table=block&id=eb4cd2f2-2e76-4539-9a5e-3366837031be)
填完就可以提交了,静静等待审核吧。这次没有具体说多久可能通过 ==。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F44869e8d-f61c-44f8-9999-7c6142a9c2e0%2F9eff351f-d510-47e2-8bb5-79240ae0f8e2.png?table=block&id=f2c3546d-6f3c-4c9f-90c3-c69d1443364c)
作者:Razeen
- 作者:Inevitable AI
- 链接:https://www.Inevitableai.ltd/article/azure_apply
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。