Jan 21
API not working with deepseek model
I got error when call api with deepseek model.
Request failed with status code 404: {"message":"Invalid model deepseek for AI feature CHAT_WITH_AI!"}
sample code in following:
import requests
import json
additional_string = " Hello."
user_content = additional_string
api_key = "" # Replace with your actual API key
endpoint = "https://api.1min.ai/api/features"
headers = {
"API-KEY": api_key,
"Content-Type": "application/json"
}
payload = {
"type": "CHAT_WITH_AI",
"model": "deepseek",
"promptObject": {
"prompt": "Hi",
"isMixed": False
}
}
# Make the API request
response = requests.post(endpoint, headers=headers, json=payload)
# Check for a successful response
if response.status_code == 200:
response_data = response.json()
#print(response_data)
# Write the full JSON response to a text file
output_file_path = "response.json" # Replace with your desired output file path
with open(output_file_path, "w") as output_file:
json.dump(response_data, output_file, indent=4)
result_object = response_data["aiRecord"]["aiRecordDetail"]["resultObject"]
for content in result_object:
print(content)
else:
print(f"Request failed with status code {response.status_code}: {response.text}")
Closed
Hi Pyro Please use "deepseek-chat" instead. Thank you!