AI Assistant API
POST /services/ai/v1/chat Auth

Send Chat Message

Request Body

FieldTypeRequiredDescriptionExample
message string No What are the best SEO strategies for our website?
conversation_id integer|null No 15
connection_id integer|null No 3
model string|null No gpt-4o
temperature number|null
min: 0 max: 2
No 0.7
max_tokens integer|null
min: 1
No 2048
use_tools boolean|null No true
tools array|null No [{"type":"function","function":{"name":"get_weather","parameters":{"type":"object","properties":{"city":{"type":"string"}}}}}]
tool_call_id string|null No call_abc123
tool_result string|null No The current temperature in Amsterdam is 18°C

Responses

500
200
404
422
401
403
429
Internal server error
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
success boolean
message string
Successful response
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
success boolean
data object
data.content string
data.model string
data.usage string
data.conversation_id integer|null
data.tool_calls mixed
Resource not found
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
success boolean
message string
Validation error
FieldTypeDescription
message string Errors overview.
errors object A detailed description of each field that failed validation.
Unauthenticated — missing or invalid Bearer token
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
Forbidden — insufficient permissions for this resource
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
Too Many Requests — rate limit exceeded
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
Retry-After integer Seconds until the rate limit resets 60
FieldTypeDescription
error boolean
message string
Base URL
https://api.wemasy.nl/api
Authentication

Request Sample
cURL
JS
PHP
Python
curl -X POST "https://api.wemasy.nl/api/services/ai/v1/chat" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What are the best SEO strategies for our website?",
    "conversation_id": 15,
    "connection_id": 3,
    "model": "gpt-4o",
    "temperature": 0.7,
    "max_tokens": 2048,
    "use_tools": true,
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "city": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    ],
    "tool_call_id": "call_abc123",
    "tool_result": "The current temperature in Amsterdam is 18\u00b0C"
}'
fetch('https://api.wemasy.nl/api/services/ai/v1/chat', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "message": "What are the best SEO strategies for our website?",
    "conversation_id": 15,
    "connection_id": 3,
    "model": "gpt-4o",
    "temperature": 0.7,
    "max_tokens": 2048,
    "use_tools": true,
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "city": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    ],
    "tool_call_id": "call_abc123",
    "tool_result": "The current temperature in Amsterdam is 18\u00b0C"
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
    ->accept('application/json')
    ->post('https://api.wemasy.nl/api/services/ai/v1/chat', {
    "message": "What are the best SEO strategies for our website?",
    "conversation_id": 15,
    "connection_id": 3,
    "model": "gpt-4o",
    "temperature": 0.7,
    "max_tokens": 2048,
    "use_tools": true,
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "city": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    ],
    "tool_call_id": "call_abc123",
    "tool_result": "The current temperature in Amsterdam is 18\u00b0C"
});
$data = $response->json();
import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = {
    "message": "What are the best SEO strategies for our website?",
    "conversation_id": 15,
    "connection_id": 3,
    "model": "gpt-4o",
    "temperature": 0.7,
    "max_tokens": 2048,
    "use_tools": true,
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "city": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    ],
    "tool_call_id": "call_abc123",
    "tool_result": "The current temperature in Amsterdam is 18\u00b0C"
}
r = requests.post("https://api.wemasy.nl/api/services/ai/v1/chat", headers=headers, json=data)
print(r.json())
Response Example
{
    "success": true,
    "data": {
        "content": "string",
        "model": "string",
        "usage": "string",
        "conversation_id": 0,
        "tool_calls": "string"
    }
}

Try It
Request Body Optional

Export