{"openapi":"3.2.0","info":{"title":"xAI All Models API","description":"50% Discount with Direct and highly available API for all Grok latest models: Grok-4.6, Grok-3, Grok Vision, and more.","version":"1.0.0"},"servers":[{"url":"https://grok.jojapi.net"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"List Models"},{"name":"OpenAI compatible Endpoints"},{"name":"Anthropic Endpoints"}],"x-agent-commerce":{"catalog_url":"https://grok.jojapi.net/_jojapi/agent/plans","discovery_url":"https://grok.jojapi.net/.well-known/x402","directory_url":"https://agents.jojapi.net/apis/grok","docs":"https://docs.jojapi.com/consumers/agents"},"paths":{"/models":{"get":{"operationId":"get_models","summary":"List Models","description":"Return a list of available models on this API","tags":["List Models"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":["grok-4.7","grok-4.6"]}}}}}},"/chat/completions":{"post":{"operationId":"post_chat_completions","summary":"Chat Completion","description":"Creates a model response for the given chat conversation.","tags":["OpenAI compatible Endpoints"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"id":"c4192582-5963-9145-b265-37e7c2acf74f","object":"chat.completion","created":1794454269,"model":"grok-4.7","choices":[{"index":0,"message":{"role":"assistant","content":"None. The other birds flew away at the sound of the gunshot.","reasoning_content":"Analyzing the classic riddle about birds in a tree.\n\nThe answer is none. The gunshot would scare the remaining birds away."},"finish_reason":"stop"}],"usage":{"prompt_tokens":1263,"completion_tokens":268,"total_tokens":1531,"prompt_tokens_details":{"cached_tokens":1152,"text_tokens":1263},"completion_tokens_details":{"reasoning_tokens":253,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"credits_details":{"credits_used":2067,"cost_in_dollars":0.002067}},"system_fingerprint":"fp_67527dda33","service_tier":"default"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object"},"example":{"model":"grok-4.7","messages":[{"role":"user","content":"There are ten birds in a tree. A hunter shoots one. How many are left in the tree?"}]}}}}}},"/responses":{"post":{"operationId":"post_responses","summary":"Responses","description":"Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model’s response.","tags":["OpenAI compatible Endpoints"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"created_at":1794454276,"id":"194eeade-6a4d-9212-b2a1-a97c80faed6f","model":"grok-4.7","object":"response","output":[{"id":"rs_194eeade-6a4d-9212-b2a1-a97c80faed6f","summary":[{"text":"Analyzing the riddle about ten birds in a tree.\n\nThe standard answer is zero. The gunshot scares the remaining birds away.","type":"summary_text"}],"type":"reasoning","status":"completed","encrypted_content":"bo1qIaLNl5Kx9tpBzGFg+QU3OhiNxmcG8tDvwcjpj2M/EpdK/vv40SieGjMczbxsTJcri3gWt/3ceRuWQSFBUmcvmWhYD+akRzXJ/+A/jL+lGxJyrXGspGlTjAt0pwgzV+an/b3faNbUWPk4OSHHY62xqiGxZQY89w3OQBZk6ZOraKNMbZjLezeLo17uMYC5VS1gec8gJHlr//tHUjE9fNspIZ6hOHix7g5CGthJ1D3oYnJm77cMAS+gV7lCF7xgUlJrUkuJobYpOca7YkToQFThgCiw8ThVp89h6KqlCAQ8Gdid1Luz6WpUbJ/CmkYemkFTHpMJn2hcWnC8jTAQEyDTvpDWBGk4SIBRC6G44cxNBrDtLJ0mdz2sDkRIjMB3PSuaTJcIhqXnn+2/oheqiG1K6b3CyIvbSWydXQ/SVwz6DOdNwJ9ixhFS/ShM9Ik/7GT3awty765vI45azsmL3fXIMiiUm+APwxErriwPAWcyOeEiOHDC6HF4Al46OS1C+Ozdpck0fJ+4ZBJBjO8wRwZq+gOQeEr0s7HG"},{"content":[{"type":"output_text","text":"None. The shot scares the rest away.","logprobs":[],"annotations":[]}],"id":"msg_194eeade-6a4d-9212-b2a1-a97c80faed6f","role":"assistant","type":"message","status":"completed"}],"reasoning":{"effort":"high","summary":"detailed"},"status":"completed","temperature":0.7,"text":{"format":{"type":"text"}},"tool_choice":"auto","top_p":0.95,"truncation":"disabled","metadata":{"system_fingerprint":"fp_67527dda33"},"background":false,"prompt_cache_key":"","safety_identifier":"","service_tier":"default","top_logprobs":0,"usage":{"input_tokens":1263,"output_tokens":199,"total_tokens":1462,"output_tokens_details":{"reasoning_tokens":189},"input_tokens_details":{"cached_tokens":1152},"credits_details":{"credits_used":1860,"cost_in_dollars":0.00186}},"completed_at":1794454279,"frequency_penalty":0,"presence_penalty":0,"store":true}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object"},"example":{"model":"grok-4.7","input":"There are ten birds in a tree. A hunter shoots one. How many are left in the tree?"}}}}}},"/messages":{"post":{"operationId":"post_messages","summary":"Messages","description":"The official Anthropic API endpoint for generating conversational responses using Claude models.\n\nThis endpoint supports text and multimodal inputs, including images and documents, depending on the capabilities of the selected model. It also supports multi-turn conversations, system instructions, tool use (function calling), extended thinking, prompt caching, structured content blocks, and configurable generation parameters.","tags":["Anthropic Endpoints"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"id":"4b539f8c-e781-908e-86fc-b6e410dbb1f1","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"Considering the classic riddle about ten birds in a tree.\n\nThe classic answer is zero. The gunshot scares the remaining birds away."},{"type":"text","text":"None. The gunshot scares the rest away, and the one that was hit falls out of the tree."}],"model":"grok-4.7","stop_reason":"end_turn","usage":{"input_tokens":1263,"output_tokens":491,"cache_creation_input_tokens":0,"cache_read_input_tokens":1152,"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"output_tokens_details":{},"credits_details":{"credits_used":2736,"cost_in_dollars":0.002736}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object"},"example":{"model":"grok-4.7","messages":[{"role":"user","content":"There are ten birds in a tree. A hunter shoots one. How many are left in the tree?"}]}}}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-JoJAPI-Key","description":"Your JoJ API key."}}}}