首页 Poe使用(提供API了!)
文章
取消

Poe使用(提供API了!)

订阅Poe是最多的,毕竟能够用多个模型。

但是使用过程确实颇为微辞,很多地方比不上原生的AI提供商:

  1. 不支持音频输入输出(现在GPT4o看起来最屌的人机交互方式)
  2. 不支持文件输出(ChatGPT网页是可以直接提供处理后的文件下载的,这很方便,比如可以直接处理数据返回excel等)
  3. 不支持API。经常看着浪费的额度,看到其他人做的好玩的应用(通过API key使用)非常羡慕,但是去买OpenAI的key是买不起的。

今天发现Poe官方开放key了:https://poe.com/api_key

用法:https://creator.poe.com/docs/accessing-other-bots-on-poe#how-to-access-the-bot-query-api-directly(就可以通过编程访问了)

  • 示例代码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
      import asyncio
      import fastapi_poe as fp
        
      # Create an asynchronous function to encapsulate the async for loop
      async def get_responses(api_key, messages):
          async for partial in fp.get_bot_response(messages=messages, bot_name="Claude-3-Opus", api_key=api_key):
              print(partial)
         
      # Replace <api_key> with your actual API key, ensuring it is a string.
      api_key = 'xxxx'
      message = fp.ProtocolMessage(role="user", content="Hello world")
        
      # Run the event loop
      # For Python 3.7 and newer
      asyncio.run(get_responses(api_key, [message]))
        
      # For Python 3.6 and older, you would typically do the following:
      # loop = asyncio.get_event_loop()
      # loop.run_until_complete(get_responses(api_key))
      # loop.close()
    

不过用到其他客户端里面作为API key使用还需要一个代理中间服务,看到一个人提供了服务:https://vpslooking.com/archives/you-poe-ding-yue-de-xiao-huo-ban–xian-zai-ke-yi-ba-poe-zhuan-huan-cheng-openai-ge-shi-de-api-le,不过没开源。

不过实测NextChat等还是使用不了,沉浸式翻译里API key可以通过测试,但是实际上翻译翻译不了,显示503.

个人了解了一下,看看后续有没有其他人做吧,毕竟开放没多久。(偷懒,不想自己写)

本文由作者按照 CC BY 4.0 进行授权

知行合一

垂直标签栏的执念