This feature is available for the LLM proxy (chat completions endpoint) and Async logging.
At Keywords AI, data privacy is our priority. We understand that you might want to disable logging for your sensitive data. We have added a disable_log option to help you achieve this.
The following fields will not be logged:
full_request
full_response
messages, prompt_messages, and completion_message
tools
See all supported parameters here.
How to disable logging?
To disable logging, set the disable_log parameter to true in the request body.
OpenAI Python SDK
OpenAI TypeScript SDK
Standard API
Other SDKs
Here is an example of how to disable logging using the OpenAI Python SDK:from openai import OpenAI
client = OpenAI(
base_url="https://api.keywordsai.co/api/",
api_key="YOUR_KEYWORDSAI_API_KEY",
)
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "user", "content": "Tell me a long story"}
],
extra_body={
"disable_log": True
}
)
Here is an example of how to disable logging in the OpenAI TypeScript SDK. In OpenAI TypeScript SDK, you should add a // @ts-expect-error before the disable_log field.import { OpenAI } from "openai";
const client = new OpenAI({
baseURL: "https://api.keywordsai.co/api",
apiKey: "YOUR_KEYWORDSAI_API_KEY",
});
const response = await client.chat.completions
.create({
messages: [{ role: "user", content: "Say this is a test" }],
model: "gpt-4o-mini",
// @ts-expect-error
disable_log: true
})
.asResponse();
console.log(await response.json());
import requests
def demo_call(input,
model="gpt-4o-mini",
token="YOUR_KEYWORDS_AI_API_KEY",
):
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {token}',
}
data = {
'model': model,
'messages': [{'role': 'user', 'content': input}],
'disable_log': True
}
response = requests.post('https://api.keywordsai.co/api/chat/completions', headers=headers, json=data)
return response
messages = "Say 'Hello World'"
print(demo_call(messages).json())
We also support adding credentials in other SDKs or languages, please check out our integration section for more information.