API Reference

Follow this guide on how to integrate CogCache using cURL.

1️⃣ Create a CogCache account

If you don't have a CogCache account you can create a CogCache account through the Microsoft Azure store. You can find the CogCache listing here.


2️⃣ Generate a CogCache API key

To authenticate the CogCache Proxy API, you need a CogCache API key. You can easily generate an API key during onboarding. Alternatively, you can go to the Keys page to generate it there.


3️⃣ Integrate CogCache with your setup

Integration steps:

  1. Change theAuthorization header to use the CogCache API key as value.
  2. Choose the right model for you from this table by setting the COGCACHE_LLM_MODEL value.
curl --location 'https://proxy-api.cogcache.com/v1/chat/completions' \
--header 'Authorization: Bearer {COGCACHE_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "messages": [
        {
            "role": "system",
            "content": "Assistant is a large language model trained by OpenAI."
        },
        {
            "role": "user",
            "content": "Write a blog post about Generative AI"
        }
    ],
    "model": "COGCACHE_LLM_MODEL",
    "stream": true
}'