All samples

Simulate OpenAI API

This sample contains a preset that allows you to easily simulate the OpenAI API using Dev Proxy. Simulating OpenAI using Dev Proxy is useful when you're working on parts of your app that don't require a real-response from an LLM and don't want to incur unnecessary costs.

Waldek Mastykarz
Waldek Mastykarz

Simulate OpenAI API

Summary

This sample contains a preset that allows you to easily simulate the OpenAI API using Dev Proxy. Simulating OpenAI using Dev Proxy is useful when you’re working on parts of your app that don’t require a real-response from an LLM and don’t want to incur unnecessary costs.

Screenshot of a command prompt with Dev Proxy simulating response for a request to OpenAI API.

Compatibility

Dev Proxy v3.1.0

Contributors

Version history

Version Date Comments
1.9 July 1, 2026 Updated to Dev Proxy v3.1.0
1.8 June 17, 2026 Updated to Dev Proxy v3.0.1
1.7 May 30, 2026 Updated to Dev Proxy v3.0.0
1.6 March 26, 2026 Updated to Dev Proxy v2.3.0
1.5 March 11, 2026 Updated to Dev Proxy v2.2.0
1.4 February 4, 2026 Updated to Dev Proxy v2.1.0
1.3 January 18, 2026 Moved config files to .devproxy folder
1.2 January 5, 2026 Updated to Dev Proxy v2.0.0
1.1 June 27, 2025 Updated for Dev Proxy v0.29.2
1.0 June 17, 2024 Initial release

Minimal path to awesome

  • Download the preset using Dev Proxy by running: devproxy config get simulate-openai
  • Start Ollama with the llama3.2 model: ollama run llama3.2
  • Start Dev Proxy specifying the path to the config file: devproxy
  • Use your app

Features

This is a generic preset for simulating OpenAI API using Ollama. By default, the preset uses the llama3.2 model, but you can use a different model by updating the configuration file.

For more information about the configuration options, see the documentation of the OpenAIMockResponsePlugin.

Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

You can try looking at issues related to this sample to see if anybody else is having the same issues.

If you encounter any issues using this sample, create a new issue.

Finally, if you have an idea for improvement, make a suggestion.

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.