### Chat Completions API Source: https://github.com/skyworkai/skyclaw/blob/main/index.html This snippet demonstrates how to use the chat completions endpoint to interact with the SkyClaw models. It shows both cURL and Python SDK examples. ```APIDOC ## Chat Completions API ### Description This endpoint allows you to send messages to the SkyClaw models and receive a text completion. It supports various roles like 'user', 'system', and 'assistant' for conversational interactions. ### Method `POST` ### Endpoint `/v1/chat/completions` ### Parameters #### Request Body - **model** (string) - Required - The ID of the model to use for completion (e.g., `skywork-ai/skyclaw-v1` or `skywork-ai/skyclaw-v1-lite`). - **messages** (array) - Required - A list of message objects, where each object has a `role` (string) and `content` (string). ### Request Example (cURL) ```bash curl https://api.apifree.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $APIFREE_API_KEY" \ -d '{ "model": "skywork-ai/skyclaw-v1", "messages": [ {"role": "user", "content": "Hello, SkyClaw!"} ] }' ``` ### Request Example (Python SDK) ```python from openai import OpenAI client = OpenAI( api_key="your-api-key", base_url="https://api.apifree.ai/v1" ) response = client.chat.completions.create( model="skywork-ai/skyclaw-v1", messages=[ {"role": "user", "content": "Hello, SkyClaw!"} ] ) print(response.choices[0].message.content) ``` ### Response #### Success Response (200) - **choices** (array) - A list of completion choices. Each choice contains a `message` object with `role` and `content`. #### Response Example ```json { "choices": [ { "message": { "role": "assistant", "content": "Hello there! How can I help you today?" } } ] } ``` ``` -------------------------------- ### Call SkyClaw API with Python OpenAI SDK Source: https://github.com/skyworkai/skyclaw/blob/main/index.html This Python script demonstrates how to use the OpenAI SDK to interact with the SkyClaw API. Replace 'your-api-key' with your actual API key and set the base URL. ```python from openai import OpenAI client = OpenAI( api_key="your-api-key", base_url="https://api.apifree.ai/v1" ) response = client.chat.completions.create( model="skywork-ai/skyclaw-v1", messages=[ {"role": "user", "content": "Hello, SkyClaw!"} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### Call SkyClaw API with cURL Source: https://github.com/skyworkai/skyclaw/blob/main/index.html Use this cURL command to send a chat completion request to the SkyClaw API. Ensure you replace '$APIFREE_API_KEY' with your actual API key. ```shell curl https://api.apifree.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $APIFREE_API_KEY" \ -d '{ "model": "skywork-ai/skyclaw-v1", "messages": [ {"role": "user", "content": "Hello, SkyClaw!"} ] }' ``` -------------------------------- ### SkyClaw-v1.0 BibTeX Citation Source: https://github.com/skyworkai/skyclaw/blob/main/README.md Use this BibTeX entry when referencing SkyClaw-v1.0 in your publications. It includes the title, authors, year, month, and URL for the model. ```bibtex @misc{skyclaw2026, title={SkyClaw-v1.0: A Million-Context Agent Model at Ultra-Low Cost}, author={Peiyu Wang and Min Zou and Liang Zeng and Wei Shen and Peng Cheng and Haoran Zhang and Yu Cheng and Yang Liu}, year={2026}, month={May}, howpublished={\url{https://skyworkai.github.io/skyclaw/}}, url={https://skyworkai.github.io/skyclaw/}, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.