Gateway setup

Start warehousing every request with a 2-line code change.

Resources

  1. Create your Velvet account here
  2. Try the sandbox demo app
  3. Fork an open source chat app with Velvet installed

Add a database

Add a Velvet hosted database to your workspace. This is where your logs will be warehoused.

If you prefer to warehouse logs to your own external PostgreSQL database, you can request access here. Switch to an external database any time. Learn more


Generate API keys

Velvet requires a velvet-auth header. This authorizes your application with the gateway.

Store the API Key as VELVET_API_KEY in your environment variables.


Update 2 lines of code

See an example for OpenAI and Javascript below. The Velvet domain is gateway.usevelvet.com.

  1. Add the Velvet baseURL
  2. Add the Velvet API key

We support OpenAI and Anthropic endpoints, and you can use any programming language.


Example code snippets

See example code snippets for each supported model provider:


Summary

Once you complete these steps, you're done. Every request will be warehoused to PostgreSQL and you'll see data populating in the Velvet UI.

  1. Add database (hosted or external)
  2. Generate API keys
  3. Swap the base URL and add your API key

Email us at [email protected] for support.