Tools
OpenAI SDKs and TypeScript frameworks
Set up OpenAI SDKs and TypeScript frameworks with Cognitivers, then verify your connection.
Connects directly
Code you write yourself. Every mainstream client takes a custom base URL, with one naming difference per language.
1. Before you begin
- OpenAI SDKs and TypeScript frameworks installed and ready to configure.
- A Cognitivers API key. See authentication and key management.
Configuration location
Your own code, or the environment
Need an API key? Request access before running these examples.
2. Configure the connection
Apply the following configuration in the location above. Replace credential placeholders with your own key; keep secrets out of version control.
# Python: the argument is base_url, the variable is OPENAI_BASE_URL
export OPENAI_BASE_URL=https://api.cognitivers.com/v1
export OPENAI_API_KEY=sk-cog-...
# Node and TypeScript: the argument is baseURL, with capital URL
# new OpenAI({ baseURL: "https://api.cognitivers.com/v1", apiKey: ... })
#
# Vercel AI SDK: createOpenAI({ baseURL, apiKey }), then openai.chat("cog-fast")
# Use .chat(), because openai("cog-fast") targets the Responses API.
# Alternative: createOpenAICompatible({ name, apiKey, baseURL })
#
# LangChain Python: pip install langchain-openai
# ChatOpenAI(model="cog-fast", base_url="https://api.cognitivers.com/v1", api_key="...")
# Precedence: the kwarg, then OPENAI_API_BASE, then OPENAI_BASE_URL.Compatibility notes
- Python uses base_url; Node uses baseURL. One letter of case, and it is the most common silent mistake.
- Vercel AI SDK: use openai.chat('cog-fast'). The default factory targets the Responses API and will fail against chat completions.
- LangChain turns stream_usage off when OPENAI_BASE_URL is set, so enable it explicitly if you count tokens in a stream.
- OpenAI Node SDK: the README documents streaming through the Responses API only. Streaming chat completions works with stream: true, but check it against your own version.
3. Verify the setup
Use this prompt in your configured tool to check authentication, a response and streaming. It reports failures without printing your key.
Open verification prompt
You are working in a repository that calls the Cognitivers API, an OpenAI-compatible chat completions endpoint.
- Base URL: https://api.cognitivers.com/v1
- Models: cog-fast, cog-pro, cog-embed
- Authentication: an API key in the Authorization header as "Bearer sk-cog-..."
Do these five things and then stop.
1. Find every place in this repository that constructs an API client for a hosted model, and tell me the file and the argument name each one uses for the base URL. I want to know whether they use base_url or baseURL, because one letter of case is the usual mistake.
2. Confirm the credential is read from the environment, and name the variable. Do not print the key.
3. Send one non-streaming request to cog-fast from the language this repository uses and show me the reply.
4. Send the same request with streaming enabled and confirm you received server-sent events. If this repository uses the Vercel AI SDK, check whether the call goes through .chat(); the default factory targets the Responses API and would fail here.
5. If any step fails, give me the exact error, the status code and the request that produced it, and stop. Do not change any file without showing me the diff first.
If everything works, say so in one line.If the check fails, use the reported status code in the error reference and review the compatibility notes above.