API Docs

ChatGuru v1.0 API Usage Descriptions

1. Completion API

Creates an answer for a given message.

POST https://api.gurai.net/developer/completion

Post parameters

api_key: Developer API Key obtained from ChatGuru application.

model: AI model name. Available models: gpt3.5, gpt4, gpt4o

message: Your message to AI.

Sample Usage

curl -d "api_key={apikey}&model=gpt3.5&message=What%20is%20the%20distance%20between%20the%20earth%20and%20the%20sun%3F" https://api.gurai.net/developer/completion

Sample Response

{"result":"success","response":"The average distance between the Earth and the Sun is about 93 million miles (150 million kilometers). This distance is known as an astronomical unit (AU).","tokens":10,"balance":104400}

2. Error Codes

100: Incorrect API Key

110: Model parameter is missing

111: Incorrect model value

120: Message parameter is missing

121: Too short message value

122: Too long message value

140: Previous api request is still executing

150: Insufficient tokens

190: Unexpected error