π» Examples
Chat Completion Example
from openai import AsyncOpenAI
client = AsyncOpenAI(
api_key='fresed-...',
base_url='https://fresedgpt.space/v1'
)
async def test_create_chat_completion():
stream = await client.chat.completions.create(
messages=[{'role': 'user', 'content': 'hi'}],
model='gpt-4',
stream=True
)
async for chunk in stream:
print(chunk.choices[0].delta.content or '', end='')
if __name__ == '__main__':
import asyncio
asyncio.run(test_create_chat_completion())Image Generation Example
Speech Generation Example
Temporary Email Example
Suno
Last updated