{"title":"WeyCP Multi-Provider Chat API Documentation","version":"2.0.0","description":"Advanced AI chat completions service with support for local, OpenAI, and Anthropic models","base_url":"https://api.weycop.com","authentication":{"type":"Bearer Token","header":"Authorization: Bearer YOUR_API_KEY","description":"All requests require a valid API key in the Authorization header"},"providers":{"local":{"description":"Local models running on Ollama","models":["weycop-chat"],"cost":"Free (compute cost only)","api_key_required":false},"openai":{"description":"OpenAI's GPT models","models":["gpt-5","gpt-5-mini","gpt-4o","gpt-4o-mini","gpt-4","gpt-3.5-turbo"],"cost":"Pay per token","api_key_required":true},"anthropic":{"description":"Anthropic's Claude models","models":["claude-sonnet-4-5-20250929","claude-sonnet-4-20250514","claude-3-7-sonnet-20250219","claude-opus-4-1-20250805","claude-3-5-haiku-20241022"],"cost":"Pay per token","api_key_required":true}},"endpoints":{"/v1/chat/completions":{"method":"POST","description":"Create a chat completion using any supported provider","authentication":"required","parameters":{"model":{"type":"string","required":true,"description":"Model to use for completion","options":["weycop-chat","gpt-5","gpt-5-mini","gpt-4o","gpt-4o-mini","gpt-4","gpt-3.5-turbo","claude-sonnet-4-5-20250929","claude-sonnet-4-20250514","claude-3-7-sonnet-20250219","claude-opus-4-1-20250805","claude-3-5-haiku-20241022"]},"provider":{"type":"string","required":false,"description":"AI provider to use: 'local', 'openai', or 'anthropic'. Auto-detected if not specified","options":["local","openai","anthropic"]},"messages":{"type":"array","required":true,"description":"Array of message objects","structure":[{"role":"system|user|assistant","content":"Message content"}]},"temperature":{"type":"float","required":false,"default":0.7,"range":"0.0 - 2.0","description":"Sampling temperature for creativity"},"max_tokens":{"type":"integer","required":false,"default":512,"description":"Maximum tokens to generate"},"top_p":{"type":"float","required":false,"default":0.9,"range":"0.0 - 1.0","description":"Nucleus sampling parameter"},"stop":{"type":"string or array","required":false,"description":"Stop sequences to end generation"},"reasoning_effort":{"type":"string","required":false,"description":"GPT-5 reasoning effort level: 'low', 'medium', 'high'. Only applies to GPT-5 models","options":["low","medium","high"]},"verbosity":{"type":"string","required":false,"description":"GPT-5 verbosity level: 'low', 'medium', 'high'. Only applies to GPT-5 models","options":["low","medium","high"]}},"example_request":{"model":"weycop-chat","messages":[{"role":"system","content":"You are a helpful assistant"},{"role":"user","content":"Hello, how are you?"}],"temperature":0.7,"max_tokens":150},"example_response":{"id":"chatcmpl-abc123","object":"chat.completion","created":1695000000,"model":"weycop-chat","usage":{"prompt_tokens":15,"completion_tokens":25,"total_tokens":40},"choices":[{"index":0,"message":{"role":"assistant","content":"Hello! I'm doing well, thank you for asking."},"finish_reason":"stop"}]}},"/v1/chat/health":{"method":"GET","description":"Check service health and available models","authentication":"not required","example_response":{"status":"healthy","ollama_models":[{"name":"qwen3:4b-instruct","size":4000000000},{"name":"llama3.1:8b-8k","size":8500000000}],"timestamp":"2025-01-01T00:00:00"}},"/v1/chat/usage":{"method":"GET","description":"Get usage statistics and quota information","authentication":"required","example_response":{"client_id":"client_123","plan":"free","usage":{"prompt_tokens":1500,"completion_tokens":800,"total_tokens":2300,"total_cost_usd":0.0046},"quota":{"monthly_allowance":100000,"monthly_used":2300,"monthly_remaining":97700}}}},"models":{"weycop-chat":{"provider":"local","description":"Gemma 4 12B with a 160K context window for long-document reasoning, coding, SQL and tool use (parallel-capable)","context_length":163840,"vram_requirement":"8.42GB","cost_per_1k_input_tokens":0.0,"cost_per_1k_output_tokens":0.0,"best_for":["complex reasoning","long context","detailed analysis","coding assistance","SQL queries"]},"gpt-5":{"provider":"openai","description":"Most advanced reasoning model with thinking capabilities","context_length":200000,"cost_per_1k_input_tokens":0.015,"cost_per_1k_output_tokens":0.06,"best_for":["complex reasoning","mathematical problems","coding challenges","scientific analysis"],"special_features":["reasoning_effort","verbosity","step-by-step thinking"]},"gpt-5-mini":{"provider":"openai","description":"Most advanced reasoning model with thinking capabilities","context_length":200000,"cost_per_1k_input_tokens":0.015,"cost_per_1k_output_tokens":0.06,"best_for":["complex reasoning","mathematical problems","coding challenges","scientific analysis"],"special_features":["reasoning_effort","verbosity","step-by-step thinking"]},"gpt-4o":{"provider":"openai","description":"High-intelligence flagship model for complex, multi-step tasks","context_length":50000,"cost_per_1k_input_tokens":0.0025,"cost_per_1k_output_tokens":0.01,"best_for":["complex reasoning","code generation","analysis","creative tasks"]},"gpt-4o-mini":{"provider":"openai","description":"Affordable and intelligent small model for fast, lightweight tasks","context_length":50000,"cost_per_1k_input_tokens":0.00015,"cost_per_1k_output_tokens":0.0006,"best_for":["quick tasks","simple reasoning","text processing"]},"gpt-4":{"provider":"openai","description":"Large multimodal model for complex tasks","context_length":15000,"cost_per_1k_input_tokens":0.03,"cost_per_1k_output_tokens":0.06,"best_for":["complex reasoning","detailed analysis","creative writing"]},"gpt-3.5-turbo":{"provider":"openai","description":"Fast and efficient model for most tasks","context_length":4096,"cost_per_1k_input_tokens":0.0005,"cost_per_1k_output_tokens":0.0015,"best_for":["general chat","quick responses","simple tasks"]},"claude-sonnet-4-5-20250929":{"provider":"anthropic","description":"Best model for complex agents and coding with highest intelligence","context_length":200000,"max_output_tokens":64000,"cost_per_1k_input_tokens":0.003,"cost_per_1k_output_tokens":0.015,"best_for":["complex reasoning","coding","agents","analysis","long documents"],"special_features":["vision","extended_thinking","priority_tier"]},"claude-sonnet-4-20250514":{"provider":"anthropic","description":"High-performance model with balanced capabilities","context_length":200000,"max_output_tokens":64000,"cost_per_1k_input_tokens":0.003,"cost_per_1k_output_tokens":0.015,"best_for":["complex reasoning","content creation","code generation","analysis"],"special_features":["vision","extended_thinking","priority_tier"]},"claude-3-7-sonnet-20250219":{"provider":"anthropic","description":"High-performance model with early extended thinking","context_length":200000,"max_output_tokens":64000,"cost_per_1k_input_tokens":0.003,"cost_per_1k_output_tokens":0.015,"best_for":["complex reasoning","content creation","code generation","analysis"],"special_features":["vision","extended_thinking","priority_tier"]},"claude-opus-4-1-20250805":{"provider":"anthropic","description":"Exceptional model for specialized complex tasks requiring advanced reasoning","context_length":200000,"max_output_tokens":32000,"cost_per_1k_input_tokens":0.015,"cost_per_1k_output_tokens":0.075,"best_for":["complex analysis","specialized tasks","research","advanced reasoning"],"special_features":["vision","extended_thinking","priority_tier","highest_intelligence"]},"claude-3-5-haiku-20241022":{"provider":"anthropic","description":"Fastest model for near-instant responsiveness","context_length":200000,"max_output_tokens":8192,"cost_per_1k_input_tokens":0.0008,"cost_per_1k_output_tokens":0.004,"best_for":["quick responses","simple tasks","real-time applications","fast processing"],"special_features":["fastest_speed","vision","priority_tier"]}},"rate_limits":{"free_plan":{"requests_per_minute":60,"requests_per_hour":1000,"tokens_per_minute":10000,"tokens_per_hour":100000,"tokens_per_day":1000000,"monthly_token_allowance":100000}},"error_codes":{"400":"Bad Request - Invalid parameters","401":"Unauthorized - Invalid or missing API key","402":"Payment Required - Quota exceeded","429":"Too Many Requests - Rate limit exceeded","503":"Service Unavailable - AI service temporarily down","504":"Gateway Timeout - Request timed out"},"examples":{"gpt5_advanced":{"description":"Using GPT-5 with advanced reasoning parameters","curl":"curl -X POST https://api.weycop.com/v1/chat/completions \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"gpt-5\",\n    \"messages\": [\n      {\"role\": \"system\", \"content\": \"You are an expert AI researcher\"},\n      {\"role\": \"user\", \"content\": \"Explain the latest advances in quantum computing\"}\n    ],\n    \"max_tokens\": 1000,\n    \"reasoning_effort\": \"high\",\n    \"verbosity\": \"medium\",\n    \"temperature\": 0.3\n  }'","python":"import requests\n\n# GPT-5 with advanced reasoning\nresponse = requests.post(\n    \"https://api.weycop.com/v1/chat/completions\",\n    headers={\n        \"Authorization\": \"Bearer YOUR_API_KEY\",\n        \"Content-Type\": \"application/json\"\n    },\n    json={\n        \"model\": \"gpt-5\",\n        \"messages\": [\n            {\"role\": \"system\", \"content\": \"You are an expert AI researcher\"},\n            {\"role\": \"user\", \"content\": \"Explain the latest advances in quantum computing\"}\n        ],\n        \"max_tokens\": 1000,\n        \"reasoning_effort\": \"high\",\n        \"verbosity\": \"medium\",\n        \"temperature\": 0.3\n    }\n)\nprint(response.json())"},"basic_chat":{"description":"Simple conversation with system prompt","curl":"curl -X POST https://api.weycop.com/v1/chat/completions \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"weycop-chat\",\n    \"messages\": [\n      {\"role\": \"system\", \"content\": \"You are a helpful assistant\"},\n      {\"role\": \"user\", \"content\": \"Explain quantum computing in simple terms\"}\n    ],\n    \"temperature\": 0.7,\n    \"max_tokens\": 200\n  }'","python":"import requests\n\nresponse = requests.post(\n    \"https://api.weycop.com/v1/chat/completions\",\n    headers={\n        \"Authorization\": \"Bearer YOUR_API_KEY\",\n        \"Content-Type\": \"application/json\"\n    },\n    json={\n        \"model\": \"weycop-chat\",\n        \"messages\": [\n            {\"role\": \"system\", \"content\": \"You are a helpful assistant\"},\n            {\"role\": \"user\", \"content\": \"Explain quantum computing in simple terms\"}\n        ],\n        \"temperature\": 0.7,\n        \"max_tokens\": 200\n    }\n)\nprint(response.json())"},"python_client":{"description":"Using the official WeyCP Python client with multi-provider support","installation":"pip install weycop","code":"from weycop import WeycopClient\n\nclient = WeycopClient(api_key=\"YOUR_API_KEY\")\n\n# Simple chat with local model\nresponse = client.chat_local(\n    model=\"weycop-chat\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant\"},\n        {\"role\": \"user\", \"content\": \"Hello, how are you?\"}\n    ]\n)\nprint(response.choices[0].message.content)\n\n# Using OpenAI models\nopenai_completion = client.chat_openai(\n    model=\"gpt-4o\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are an expert programmer\"},\n        {\"role\": \"user\", \"content\": \"Write a Python function to sort a list\"}\n    ],\n    temperature=0.3,\n    max_tokens=300\n)\nprint(openai_completion.choices[0].message.content)\n\n# Using Anthropic models  \nanthropic_completion = client.chat_anthropic(\n    model=\"claude-3-5-sonnet-20241022\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"Explain quantum computing\"}\n    ],\n    max_tokens=200\n)\nprint(anthropic_completion.choices[0].message.content)\n\n# Auto-detect provider (you can omit the provider parameter)\nauto_completion = client.chat_completions_create(\n    model=\"gpt-4o\",  # Provider will be auto-detected as \"openai\"\n    messages=[\n        {\"role\": \"user\", \"content\": \"What is machine learning?\"}\n    ]\n)\nprint(auto_completion.choices[0].message.content)"}},"support":{"email":"apps@weycop.com","python_package":"https://pypi.org/project/weycop/","swagger_docs":"https://api.weycop.com/docs"}}