A Mock API for Developing and Testing Generative AI Apps
How to use
1
Select provider
2
Set the base URL used by your client code to
3
Set the API key(this key is unique to you).
4
Make a request to get a chat completion and receive the default stubbed response (fast!). See code examples
5
Set the next response via the text box below then make another completion request and receive the response you configured.
6
When you're ready to switch to the live API, simply switch back the base URL and API key parameters and you're good to go!
import os
import openai
openai.api_base = "http://mockgpt-3.fly.dev"
openai.api_key = "xVY856Sh7qkENs9c"
chat_completion = openai.ChatCompletion.create(model= "gpt-3.5-turbo", messages=[{"role": "user", "content": "Hello world"}])
print(chat_completion.choices[0].message.content)
Debug