### Create Task API Request Example (cURL) Source: https://iterx.deep-reinforce.com/docs/index Example of creating a new code optimization task using a cURL request. This includes setting task details, initial code, sample size, and the model to be used. It demonstrates the required headers for authentication and content type. ```bash curl -X POST https://iterx.deep-reinforce.com/api/task/create \ -H "Authorization: sk-xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "task_name": "GEMM Optimization", "task_description": "Optimize matrix multiplication performance to exceed cuBLAS baseline. Evaluation metrics: execution time (ms) and TFLOPS, using relative scoring.", "reward_description": "Performance improvement percentage", "initial_code": "def gemm(A, B):\n return A @ B", "sample_size": 4, "model": "qwen3-235b-instruct-2507" }' ``` -------------------------------- ### Get Code by ID Source: https://iterx.deep-reinforce.com/docs/index Retrieves the complete code content for a given code ID. This endpoint is used to fetch the source code associated with a specific submission. ```APIDOC ## POST /api/get_code_by_id ### Description Retrieves the complete code content for a given code ID. ### Method POST ### Endpoint /api/get_code_by_id ### Parameters #### Request Body - **code_id** (string) - Required - Code ID ### Request Example ```json { "code_id": "a1b2c3d4e5f6g7h8" } ``` ### Response #### Success Response (200) - **code** (string) - Code content #### Response Example ```json { "code": 200, "message": "success", "data": { "code": "import torch\n\ndef optimized_gemm(A, B):\n return torch.matmul(A, B)" }, "request_id": "550e8400-e29b-41d4-a716-446655440000" } ``` ``` -------------------------------- ### Get Code by ID (API) Source: https://iterx.deep-reinforce.com/docs/index Retrieves the complete source code content for a specific code ID. This is essential for reviewing or analyzing individual code submissions. The request requires a valid `code_id` and authentication. ```curl curl -X POST https://iterx.deep-reinforce.com/api/get_code_by_id \ -H "Authorization: sk-xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ \ "code_id": "a1b2c3d4e5f6g7h8" \ }' ``` -------------------------------- ### POST /api/task/create Source: https://iterx.deep-reinforce.com/docs/index Creates a new code optimization task with specified parameters. ```APIDOC ## POST /api/task/create ### Description Creates a new code optimization task. This endpoint allows users to define task names, descriptions, reward criteria, initial code, sample size, and the model to be used for optimization. ### Method POST ### Endpoint /api/task/create ### Parameters #### Query Parameters - **task_name** (string) - Required - The name of the task. - **task_description** (string) - Optional - A detailed description of the task, including evaluation methodology and reward criteria. - **reward_description** (string) - Optional - Describes the reward mechanism for the task. - **initial_code** (string) - Optional - The initial code snippet for the task. If provided, a code record with sequence number 0 is automatically created. - **sample_size** (int) - Optional - The number of samples to use for evaluation. Valid values are 1, 2, 4, or 8. Defaults to 1. - **model** (string) - Optional - The name of the model to use for the task. Defaults to 'qwen3-235b-instruct-2507'. ### Request Example ```json { "task_name": "GEMM Optimization", "task_description": "Optimize matrix multiplication performance to exceed cuBLAS baseline. Evaluation metrics: execution time (ms) and TFLOPS, using relative scoring.", "reward_description": "Performance improvement percentage", "initial_code": "def gemm(A, B):\n return A @ B", "sample_size": 4, "model": "qwen3-235b-instruct-2507" } ``` ### Response #### Success Response (200) - **task_id** (string) - The unique identifier (UUID) for the created task. - **id** (int) - The database ID of the created task. - **initial_code_id** (string) - The ID of the initial code record, if `initial_code` was provided. - **message** (string) - A confirmation message indicating successful task creation. #### Response Example ```json { "code": 200, "message": "success", "data": { "task_id": "550e8400-e29b-41d4-a716-446655440000", "id": 1, "initial_code_id": "a1b2c3d4e5f6g7h8", "message": "Task created successfully" }, "request_id": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Notes - Task creation requires a token balance greater than 0, but does not consume tokens. - The `sample_size` parameter only accepts the values 1, 2, 4, or 8. - If `initial_code` is supplied, a corresponding code record is automatically generated by the system. ``` -------------------------------- ### Query Training Status Source: https://iterx.deep-reinforce.com/docs/index Retrieves the current training progress, evaluation statistics, and code leaderboard for a specified task. ```APIDOC ## POST /api/get_training_status ### Description Retrieves training progress, evaluation statistics, and code leaderboard for a task. ### Method POST ### Endpoint /api/get_training_status ### Parameters #### Query Parameters - None #### Request Body - **task_id** (string) - Required - Task ID (UUID) ### Request Example ```json { "task_id": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Response #### Success Response (200) - **progress_percentage** (float) - Task progress percentage (0-100) - **total_evaluated** (int) - Total number of evaluated code submissions - **best** (object) - Best performing code information - **code_id** (string) - Best code ID - **reward** (float) - Highest reward score - **top5** (array) - Top 5 code submissions (sorted by score descending) - **code_id** (string) - Code ID - **reward** (float) - Reward score - **all_evaluated** (array) - All evaluated code submissions (sorted by score descending) - **code_id** (string) - Code ID - **reward** (float) - Reward score - **task_is_finished** (bool) - Whether the task is complete #### Response Example ```json { "code": 200, "message": "success", "data": { "progress_percentage": 32.0, "total_evaluated": 50, "best": { "code_id": "a1b2c3d4e5f6g7h8", "reward": 98.5 }, "top5": [ { "code_id": "a1b2c3d4e5f6g7h8", "reward": 98.5 }, { "code_id": "b2c3d4e5f6g7h8i9", "reward": 95.2 }, { "code_id": "c3d4e5f6g7h8i9j0", "reward": 92.8 }, { "code_id": "d4e5f6g7h8i9j0k1", "reward": 90.1 }, { "code_id": "e5f6g7h8i9j0k1l2", "reward": 88.5 } ], "all_evaluated": [ { "code_id": "a1b2c3d4e5f6g7h8", "reward": 98.5 } ], "task_is_finished": false }, "request_id": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Notes - Only returns evaluated code submissions (where `has_reward = true`). - Leaderboard is sorted by `reward` in descending order. - `top5` returns a maximum of 5 code submissions. ``` -------------------------------- ### Query Training Status using cURL Source: https://iterx.deep-reinforce.com/docs/index Retrieves the current training progress, evaluation statistics, and code leaderboard for a specified task. This endpoint requires a task ID and an authorization header. The response includes detailed metrics about the task's performance and completion status. ```curl curl -X POST https://iterx.deep-reinforce.com/api/get_training_status \ -H "Authorization: sk-xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "task_id": "550e8400-e29b-41d4-a716-446655440000" }' ``` -------------------------------- ### Submit Code Reward (API) Source: https://iterx.deep-reinforce.com/docs/index Evaluates a code submission and submits a reward score along with optional details. This endpoint is crucial for the reinforcement learning loop, allowing the system to learn from the submitted code. `reward` must be non-negative, and if `correctness_check` is false, `reward` must be 0. ```curl curl -X POST https://iterx.deep-reinforce.com/api/push_code_reward_by_id \ -H "Authorization: sk-xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ \ "task_id": "550e8400-e29b-41d4-a716-446655440000", \ "code_id": "a1b2c3d4e5f6g7h8", \ "reward": 85.5, \ "correctness_check": true, \ "details": "", \ "code_error_msg": "" \ }' ``` -------------------------------- ### Submit Code Reward Source: https://iterx.deep-reinforce.com/docs/index Evaluates code and submits a reward score. This endpoint is used to provide feedback on code submissions, including a reward, correctness check, and optional details. ```APIDOC ## POST /api/push_code_reward_by_id ### Description Evaluates code and submits a reward score. ### Method POST ### Endpoint /api/push_code_reward_by_id ### Parameters #### Request Body - **task_id** (string) - Required - Task ID - **code_id** (string) - Required - Code ID - **reward** (float) - Required - Reward score (must be >= 0) - **correctness_check** (bool) - Optional - Whether the code passes correctness validation - **details** (string) - Optional - Evaluation details - **code_error_msg** (string) - Optional - Code error message ### Request Example ```json { "task_id": "550e8400-e29b-41d4-a716-446655440000", "code_id": "a1b2c3d4e5f6g7h8", "reward": 85.5, "correctness_check": true, "details": "", "code_error_msg": "" } ``` ### Response #### Success Response (200) - **task_id** (string) - Task ID - **code_id** (string) - Code ID - **reward** (float) - Reward score - **correctness_check** (bool) - Correctness check result - **status** (string) - Task status after reward submission #### Response Example ```json { "code": 200, "message": "success", "data": { "message": "Scoring successful", "task_id": "550e8400-e29b-41d4-a716-446655440000", "code_id": "a1b2c3d4e5f6g7h8", "reward": 85.5, "correctness_check": true, "status": "ongoing" }, "request_id": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Reward Rules - `reward` must be non-negative. - When `correctness_check = false`, `reward` must be 0. ``` -------------------------------- ### Fetch Unevaluated Code IDs (API) Source: https://iterx.deep-reinforce.com/docs/index Retrieves a list of unevaluated code IDs for a given task. This endpoint is useful for batch processing or monitoring the status of code submissions. It only returns submissions where `has_reward` is false and is restricted to tasks created by the current user. ```curl curl -X POST https://iterx.deep-reinforce.com/api/fetch_unevaluated_code_ids \ -H "Authorization: sk-xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ \ "task_id": "550e8400-e29b-41d4-a716-446655440000" \ }' ``` -------------------------------- ### Fetch Unevaluated Code IDs Source: https://iterx.deep-reinforce.com/docs/index Retrieves a list of all unevaluated code IDs for a specified task. This endpoint is useful for batch processing or identifying code submissions that require evaluation. ```APIDOC ## POST /api/fetch_unevaluated_code_ids ### Description Retrieves a list of all unevaluated code IDs for a specified task. ### Method POST ### Endpoint /api/fetch_unevaluated_code_ids ### Parameters #### Request Body - **task_id** (string) - Required - Task ID (UUID) ### Request Example ```json { "task_id": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Response #### Success Response (200) - **total_code_count** (int) - Total number of unevaluated code submissions - **code_id_list** (array) - List of unevaluated code IDs - **task_is_finished** (bool) - Whether the task is complete #### Response Example ```json { "code": 200, "message": "success", "data": { "total_code_count": 5, "code_id_list": ["a1b2c3d4e5f6g7h8", "b2c3d4e5f6g7h8i9", "c3d4e5f6g7h8i9j0", "d4e5f6g7h8i9j0k1", "e5f6g7h8i9j0k1l2"], "task_is_finished": false }, "request_id": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Notes - Only returns unevaluated code submissions (where `has_reward = false`). - Only accessible for tasks created by the current user. - Returns an empty array when no pending code submissions exist. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.