{
  "schemaVersion": "1.0",
  "item": {
    "slug": "doubleword",
    "name": "Doubleword API",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/pjb157/doubleword",
    "canonicalUrl": "https://clawhub.ai/pjb157/doubleword",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/doubleword",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=doubleword",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/create_batch_file.py",
      "references/pricing.md",
      "references/api_reference.md",
      "references/getting_started.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/doubleword"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/doubleword",
    "agentPageUrl": "https://openagent3.xyz/skills/doubleword/agent",
    "manifestUrl": "https://openagent3.xyz/skills/doubleword/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/doubleword/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Doubleword Batch Inference",
        "body": "Process multiple AI inference requests asynchronously using the Doubleword batch API with high throughput and low cost."
      },
      {
        "title": "Prerequisites",
        "body": "Before submitting batches, you need:\n\nDoubleword Account - Sign up at https://app.doubleword.ai/\nAPI Key - Create one in the API Keys section of your dashboard\nAccount Credits - Add credits to process requests (see pricing below)"
      },
      {
        "title": "When to Use Batches",
        "body": "Batches are ideal for:\n\nMultiple independent requests that can run simultaneously\nWorkloads that don't require immediate responses\nLarge volumes that would exceed rate limits if sent individually\nCost-sensitive workloads (24h window = 50-60% cheaper than realtime)\nTool calling and structured output generation at scale"
      },
      {
        "title": "Available Models & Pricing",
        "body": "Pricing is per 1 million tokens (input / output):\n\nQwen3-VL-30B-A3B-Instruct-FP8 (mid-size):\n\nRealtime SLA: $0.16 / $0.80\n1-hour SLA: $0.07 / $0.30 (56% cheaper)\n24-hour SLA: $0.05 / $0.20 (69% cheaper)\n\nQwen3-VL-235B-A22B-Instruct-FP8 (flagship):\n\nRealtime SLA: $0.60 / $1.20\n1-hour SLA: $0.15 / $0.55 (75% cheaper)\n24-hour SLA: $0.10 / $0.40 (83% cheaper)\nSupports up to 262K total tokens, 16K new tokens per request\n\nCost estimation: Upload files to the Doubleword Console to preview expenses before submitting."
      },
      {
        "title": "Quick Start",
        "body": "Two ways to submit batches:\n\nVia API:\n\nCreate JSONL file with requests\nUpload file to get file ID\nCreate batch using file ID\nPoll status until complete\nDownload results from output_file_id\n\nVia Web Console:\n\nNavigate to Batches section at https://app.doubleword.ai/\nUpload JSONL file\nConfigure batch settings (model, completion window)\nMonitor progress in real-time dashboard\nDownload results when ready"
      },
      {
        "title": "Step 1: Create Batch Request File",
        "body": "Create a .jsonl file where each line contains a complete, valid JSON object with no line breaks within the object:\n\n{\"custom_id\": \"req-1\", \"method\": \"POST\", \"url\": \"/v1/chat/completions\", \"body\": {\"model\": \"anthropic/claude-3-5-sonnet\", \"messages\": [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]}}\n{\"custom_id\": \"req-2\", \"method\": \"POST\", \"url\": \"/v1/chat/completions\", \"body\": {\"model\": \"anthropic/claude-3-5-sonnet\", \"messages\": [{\"role\": \"user\", \"content\": \"What is the capital of France?\"}]}}\n\nRequired fields per line:\n\ncustom_id: Unique identifier (max 64 chars) - use descriptive IDs like \"user-123-question-5\" for easier result mapping\nmethod: Always \"POST\"\nurl: API endpoint - \"/v1/chat/completions\" or \"/v1/embeddings\"\nbody: Standard API request with model and messages\n\nOptional body parameters:\n\ntemperature: 0-2 (default: 1.0)\nmax_tokens: Maximum response tokens\ntop_p: Nucleus sampling parameter\nstop: Stop sequences\ntools: Tool definitions for tool calling (see Tool Calling section)\nresponse_format: JSON schema for structured outputs (see Structured Outputs section)\n\nFile requirements:\n\nMax size: 200MB\nFormat: JSONL only (JSON Lines - newline-delimited JSON)\nEach line must be valid JSON with no internal line breaks\nNo duplicate custom_id values\nSplit large batches into multiple files if needed\n\nCommon pitfalls:\n\nLine breaks within JSON objects (will cause parsing errors)\nInvalid JSON syntax\nDuplicate custom_id values\n\nHelper script:\nUse scripts/create_batch_file.py to generate JSONL files programmatically:\n\npython scripts/create_batch_file.py output.jsonl\n\nModify the script's requests list to generate your specific batch requests."
      },
      {
        "title": "Step 2: Upload File",
        "body": "Via API:\n\ncurl https://api.doubleword.ai/v1/files \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  -F purpose=\"batch\" \\\n  -F file=\"@batch_requests.jsonl\"\n\nVia Console:\nUpload through the Batches section at https://app.doubleword.ai/\n\nResponse contains id field - save this file ID for next step."
      },
      {
        "title": "Step 3: Create Batch",
        "body": "Via API:\n\ncurl https://api.doubleword.ai/v1/batches \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"input_file_id\": \"file-abc123\",\n    \"endpoint\": \"/v1/chat/completions\",\n    \"completion_window\": \"24h\"\n  }'\n\nVia Console:\nConfigure batch settings in the web interface.\n\nParameters:\n\ninput_file_id: File ID from upload step\nendpoint: API endpoint (\"/v1/chat/completions\" or \"/v1/embeddings\")\ncompletion_window: Choose based on urgency and budget:\n\n\"24h\": Best pricing, results within 24 hours (typically faster)\n\"1h\": 50% price premium, results within 1 hour (typically faster)\nRealtime: Limited capacity, highest cost (batch service optimized for async)\n\nResponse contains batch id - save this for status polling.\n\nBefore submitting, verify:\n\nYou have access to the specified model\nYour API key is active\nYou have sufficient account credits"
      },
      {
        "title": "Step 4: Poll Status",
        "body": "Via API:\n\ncurl https://api.doubleword.ai/v1/batches/batch-xyz789 \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\"\n\nVia Console:\nMonitor real-time progress in the Batches dashboard.\n\nStatus progression:\n\nvalidating - Checking input file format\nin_progress - Processing requests\ncompleted - All requests finished\n\nOther statuses:\n\nfailed - Batch failed (check error_file_id)\nexpired - Batch timed out\ncancelling/cancelled - Batch cancelled\n\nResponse includes:\n\noutput_file_id - Download results here\nerror_file_id - Failed requests (if any)\nrequest_counts - Total/completed/failed counts\n\nPolling frequency: Check every 30-60 seconds during processing.\n\nEarly access: Results available via output_file_id before batch fully completes - check X-Incomplete header."
      },
      {
        "title": "Step 5: Download Results",
        "body": "Via API:\n\ncurl https://api.doubleword.ai/v1/files/file-output123/content \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  > results.jsonl\n\nVia Console:\nDownload results directly from the Batches dashboard.\n\nResponse headers:\n\nX-Incomplete: true - Batch still processing, more results coming\nX-Last-Line: 45 - Resume point for partial downloads\n\nOutput format (each line):\n\n{\n  \"id\": \"batch-req-abc\",\n  \"custom_id\": \"request-1\",\n  \"response\": {\n    \"status_code\": 200,\n    \"body\": {\n      \"id\": \"chatcmpl-xyz\",\n      \"choices\": [{\n        \"message\": {\n          \"role\": \"assistant\",\n          \"content\": \"The answer is 4.\"\n        }\n      }]\n    }\n  }\n}\n\nDownload errors (if any):\n\ncurl https://api.doubleword.ai/v1/files/file-error123/content \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  > errors.jsonl\n\nError format (each line):\n\n{\n  \"id\": \"batch-req-def\",\n  \"custom_id\": \"request-2\",\n  \"error\": {\n    \"code\": \"invalid_request\",\n    \"message\": \"Missing required parameter\"\n  }\n}"
      },
      {
        "title": "Tool Calling in Batches",
        "body": "Tool calling (function calling) enables models to intelligently select and use external tools. Doubleword maintains full OpenAI compatibility.\n\nExample batch request with tools:\n\n{\n  \"custom_id\": \"tool-req-1\",\n  \"method\": \"POST\",\n  \"url\": \"/v1/chat/completions\",\n  \"body\": {\n    \"model\": \"anthropic/claude-3-5-sonnet\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"What's the weather in Paris?\"}],\n    \"tools\": [{\n      \"type\": \"function\",\n      \"function\": {\n        \"name\": \"get_weather\",\n        \"description\": \"Get current weather for a location\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"location\": {\"type\": \"string\"}\n          },\n          \"required\": [\"location\"]\n        }\n      }\n    }]\n  }\n}\n\nUse cases:\n\nAgents that interact with APIs at scale\nFetching real-time information for multiple queries\nExecuting actions through standardized tool definitions"
      },
      {
        "title": "Structured Outputs in Batches",
        "body": "Structured outputs guarantee that model responses conform to your JSON Schema, eliminating issues with missing fields or invalid enum values.\n\nExample batch request with structured output:\n\n{\n  \"custom_id\": \"structured-req-1\",\n  \"method\": \"POST\",\n  \"url\": \"/v1/chat/completions\",\n  \"body\": {\n    \"model\": \"anthropic/claude-3-5-sonnet\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Extract key info from: John Doe, 30 years old, lives in NYC\"}],\n    \"response_format\": {\n      \"type\": \"json_schema\",\n      \"json_schema\": {\n        \"name\": \"person_info\",\n        \"schema\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"name\": {\"type\": \"string\"},\n            \"age\": {\"type\": \"integer\"},\n            \"city\": {\"type\": \"string\"}\n          },\n          \"required\": [\"name\", \"age\", \"city\"]\n        }\n      }\n    }\n  }\n}\n\nBenefits:\n\nGuaranteed schema compliance\nNo missing required keys\nNo hallucinated enum values\nSeamless OpenAI compatibility"
      },
      {
        "title": "autobatcher: Automatic Batching",
        "body": "autobatcher is a Python client that automatically converts individual API calls into batched requests, reducing costs without code changes.\n\nInstallation:\n\npip install autobatcher\n\nHow it works:\n\nCollection Phase: Requests accumulate during a time window (default: 1 second) or until batch size threshold\nBatch Submission: Collected requests are submitted together\nResult Polling: System monitors for completed responses\nTransparent Response: Your code receives standard ChatCompletion responses\n\nKey benefit: Significant cost reduction through automatic batching while writing normal async code using the familiar OpenAI interface.\n\nDocumentation: https://github.com/doublewordai/autobatcher"
      },
      {
        "title": "List All Batches",
        "body": "Via API:\n\ncurl https://api.doubleword.ai/v1/batches?limit=10 \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\"\n\nVia Console:\nView all batches in the dashboard."
      },
      {
        "title": "Cancel Batch",
        "body": "Via API:\n\ncurl https://api.doubleword.ai/v1/batches/batch-xyz789/cancel \\\n  -X POST \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\"\n\nVia Console:\nClick cancel in the batch details view.\n\nNotes:\n\nUnprocessed requests are cancelled\nAlready-processed results remain downloadable\nOnly charged for completed work\nCannot cancel completed batches"
      },
      {
        "title": "Processing Results",
        "body": "Parse JSONL output line-by-line:\n\nimport json\n\nwith open('results.jsonl') as f:\n    for line in f:\n        result = json.loads(line)\n        custom_id = result['custom_id']\n        content = result['response']['body']['choices'][0]['message']['content']\n        print(f\"{custom_id}: {content}\")"
      },
      {
        "title": "Handling Partial Results",
        "body": "Check for incomplete batches and resume:\n\nimport requests\n\nresponse = requests.get(\n    'https://api.doubleword.ai/v1/files/file-output123/content',\n    headers={'Authorization': f'Bearer {api_key}'}\n)\n\nif response.headers.get('X-Incomplete') == 'true':\n    last_line = int(response.headers.get('X-Last-Line', 0))\n    print(f\"Batch incomplete. Processed {last_line} requests so far.\")\n    # Continue polling and download again later"
      },
      {
        "title": "Retry Failed Requests",
        "body": "Extract failed requests from error file and resubmit:\n\nimport json\n\nfailed_ids = []\nwith open('errors.jsonl') as f:\n    for line in f:\n        error = json.loads(line)\n        failed_ids.append(error['custom_id'])\n\nprint(f\"Failed requests: {failed_ids}\")\n# Create new batch with only failed requests"
      },
      {
        "title": "Processing Tool Calls",
        "body": "Handle tool call responses:\n\nimport json\n\nwith open('results.jsonl') as f:\n    for line in f:\n        result = json.loads(line)\n        message = result['response']['body']['choices'][0]['message']\n\n        if message.get('tool_calls'):\n            for tool_call in message['tool_calls']:\n                print(f\"Tool: {tool_call['function']['name']}\")\n                print(f\"Args: {tool_call['function']['arguments']}\")"
      },
      {
        "title": "Best Practices",
        "body": "Descriptive custom_ids: Include context in IDs for easier result mapping\n\nGood: \"user-123-question-5\", \"dataset-A-row-42\"\nBad: \"1\", \"req1\"\n\n\n\nValidate JSONL locally: Ensure each line is valid JSON with no internal line breaks before upload\n\n\nNo duplicate IDs: Each custom_id must be unique within the batch\n\n\nSplit large files: Keep under 200MB limit by splitting into multiple batches\n\n\nChoose appropriate window: Use 24h for cost savings (50-83% cheaper), 1h only when time-sensitive\n\n\nHandle errors gracefully: Always check error_file_id and retry failed requests\n\n\nMonitor request_counts: Track progress via completed/total ratio\n\n\nSave file IDs: Store batch_id, input_file_id, output_file_id for later retrieval\n\n\nUse cost estimator: Preview expenses in console before submitting large batches\n\n\nConsider autobatcher: For ongoing workloads, use autobatcher to automatically batch individual API calls"
      },
      {
        "title": "Reference Documentation",
        "body": "For complete API details, see:\n\nAPI Reference: references/api_reference.md - Full endpoint documentation and schemas\nGetting Started Guide: references/getting_started.md - Detailed setup and account management\nPricing Details: references/pricing.md - Model costs and SLA comparison"
      }
    ],
    "body": "Doubleword Batch Inference\n\nProcess multiple AI inference requests asynchronously using the Doubleword batch API with high throughput and low cost.\n\nPrerequisites\n\nBefore submitting batches, you need:\n\nDoubleword Account - Sign up at https://app.doubleword.ai/\nAPI Key - Create one in the API Keys section of your dashboard\nAccount Credits - Add credits to process requests (see pricing below)\nWhen to Use Batches\n\nBatches are ideal for:\n\nMultiple independent requests that can run simultaneously\nWorkloads that don't require immediate responses\nLarge volumes that would exceed rate limits if sent individually\nCost-sensitive workloads (24h window = 50-60% cheaper than realtime)\nTool calling and structured output generation at scale\nAvailable Models & Pricing\n\nPricing is per 1 million tokens (input / output):\n\nQwen3-VL-30B-A3B-Instruct-FP8 (mid-size):\n\nRealtime SLA: $0.16 / $0.80\n1-hour SLA: $0.07 / $0.30 (56% cheaper)\n24-hour SLA: $0.05 / $0.20 (69% cheaper)\n\nQwen3-VL-235B-A22B-Instruct-FP8 (flagship):\n\nRealtime SLA: $0.60 / $1.20\n1-hour SLA: $0.15 / $0.55 (75% cheaper)\n24-hour SLA: $0.10 / $0.40 (83% cheaper)\nSupports up to 262K total tokens, 16K new tokens per request\n\nCost estimation: Upload files to the Doubleword Console to preview expenses before submitting.\n\nQuick Start\n\nTwo ways to submit batches:\n\nVia API:\n\nCreate JSONL file with requests\nUpload file to get file ID\nCreate batch using file ID\nPoll status until complete\nDownload results from output_file_id\n\nVia Web Console:\n\nNavigate to Batches section at https://app.doubleword.ai/\nUpload JSONL file\nConfigure batch settings (model, completion window)\nMonitor progress in real-time dashboard\nDownload results when ready\nWorkflow\nStep 1: Create Batch Request File\n\nCreate a .jsonl file where each line contains a complete, valid JSON object with no line breaks within the object:\n\n{\"custom_id\": \"req-1\", \"method\": \"POST\", \"url\": \"/v1/chat/completions\", \"body\": {\"model\": \"anthropic/claude-3-5-sonnet\", \"messages\": [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]}}\n{\"custom_id\": \"req-2\", \"method\": \"POST\", \"url\": \"/v1/chat/completions\", \"body\": {\"model\": \"anthropic/claude-3-5-sonnet\", \"messages\": [{\"role\": \"user\", \"content\": \"What is the capital of France?\"}]}}\n\n\nRequired fields per line:\n\ncustom_id: Unique identifier (max 64 chars) - use descriptive IDs like \"user-123-question-5\" for easier result mapping\nmethod: Always \"POST\"\nurl: API endpoint - \"/v1/chat/completions\" or \"/v1/embeddings\"\nbody: Standard API request with model and messages\n\nOptional body parameters:\n\ntemperature: 0-2 (default: 1.0)\nmax_tokens: Maximum response tokens\ntop_p: Nucleus sampling parameter\nstop: Stop sequences\ntools: Tool definitions for tool calling (see Tool Calling section)\nresponse_format: JSON schema for structured outputs (see Structured Outputs section)\n\nFile requirements:\n\nMax size: 200MB\nFormat: JSONL only (JSON Lines - newline-delimited JSON)\nEach line must be valid JSON with no internal line breaks\nNo duplicate custom_id values\nSplit large batches into multiple files if needed\n\nCommon pitfalls:\n\nLine breaks within JSON objects (will cause parsing errors)\nInvalid JSON syntax\nDuplicate custom_id values\n\nHelper script: Use scripts/create_batch_file.py to generate JSONL files programmatically:\n\npython scripts/create_batch_file.py output.jsonl\n\n\nModify the script's requests list to generate your specific batch requests.\n\nStep 2: Upload File\n\nVia API:\n\ncurl https://api.doubleword.ai/v1/files \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  -F purpose=\"batch\" \\\n  -F file=\"@batch_requests.jsonl\"\n\n\nVia Console: Upload through the Batches section at https://app.doubleword.ai/\n\nResponse contains id field - save this file ID for next step.\n\nStep 3: Create Batch\n\nVia API:\n\ncurl https://api.doubleword.ai/v1/batches \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"input_file_id\": \"file-abc123\",\n    \"endpoint\": \"/v1/chat/completions\",\n    \"completion_window\": \"24h\"\n  }'\n\n\nVia Console: Configure batch settings in the web interface.\n\nParameters:\n\ninput_file_id: File ID from upload step\nendpoint: API endpoint (\"/v1/chat/completions\" or \"/v1/embeddings\")\ncompletion_window: Choose based on urgency and budget:\n\"24h\": Best pricing, results within 24 hours (typically faster)\n\"1h\": 50% price premium, results within 1 hour (typically faster)\nRealtime: Limited capacity, highest cost (batch service optimized for async)\n\nResponse contains batch id - save this for status polling.\n\nBefore submitting, verify:\n\nYou have access to the specified model\nYour API key is active\nYou have sufficient account credits\nStep 4: Poll Status\n\nVia API:\n\ncurl https://api.doubleword.ai/v1/batches/batch-xyz789 \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\"\n\n\nVia Console: Monitor real-time progress in the Batches dashboard.\n\nStatus progression:\n\nvalidating - Checking input file format\nin_progress - Processing requests\ncompleted - All requests finished\n\nOther statuses:\n\nfailed - Batch failed (check error_file_id)\nexpired - Batch timed out\ncancelling/cancelled - Batch cancelled\n\nResponse includes:\n\noutput_file_id - Download results here\nerror_file_id - Failed requests (if any)\nrequest_counts - Total/completed/failed counts\n\nPolling frequency: Check every 30-60 seconds during processing.\n\nEarly access: Results available via output_file_id before batch fully completes - check X-Incomplete header.\n\nStep 5: Download Results\n\nVia API:\n\ncurl https://api.doubleword.ai/v1/files/file-output123/content \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  > results.jsonl\n\n\nVia Console: Download results directly from the Batches dashboard.\n\nResponse headers:\n\nX-Incomplete: true - Batch still processing, more results coming\nX-Last-Line: 45 - Resume point for partial downloads\n\nOutput format (each line):\n\n{\n  \"id\": \"batch-req-abc\",\n  \"custom_id\": \"request-1\",\n  \"response\": {\n    \"status_code\": 200,\n    \"body\": {\n      \"id\": \"chatcmpl-xyz\",\n      \"choices\": [{\n        \"message\": {\n          \"role\": \"assistant\",\n          \"content\": \"The answer is 4.\"\n        }\n      }]\n    }\n  }\n}\n\n\nDownload errors (if any):\n\ncurl https://api.doubleword.ai/v1/files/file-error123/content \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\" \\\n  > errors.jsonl\n\n\nError format (each line):\n\n{\n  \"id\": \"batch-req-def\",\n  \"custom_id\": \"request-2\",\n  \"error\": {\n    \"code\": \"invalid_request\",\n    \"message\": \"Missing required parameter\"\n  }\n}\n\nTool Calling in Batches\n\nTool calling (function calling) enables models to intelligently select and use external tools. Doubleword maintains full OpenAI compatibility.\n\nExample batch request with tools:\n\n{\n  \"custom_id\": \"tool-req-1\",\n  \"method\": \"POST\",\n  \"url\": \"/v1/chat/completions\",\n  \"body\": {\n    \"model\": \"anthropic/claude-3-5-sonnet\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"What's the weather in Paris?\"}],\n    \"tools\": [{\n      \"type\": \"function\",\n      \"function\": {\n        \"name\": \"get_weather\",\n        \"description\": \"Get current weather for a location\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"location\": {\"type\": \"string\"}\n          },\n          \"required\": [\"location\"]\n        }\n      }\n    }]\n  }\n}\n\n\nUse cases:\n\nAgents that interact with APIs at scale\nFetching real-time information for multiple queries\nExecuting actions through standardized tool definitions\nStructured Outputs in Batches\n\nStructured outputs guarantee that model responses conform to your JSON Schema, eliminating issues with missing fields or invalid enum values.\n\nExample batch request with structured output:\n\n{\n  \"custom_id\": \"structured-req-1\",\n  \"method\": \"POST\",\n  \"url\": \"/v1/chat/completions\",\n  \"body\": {\n    \"model\": \"anthropic/claude-3-5-sonnet\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Extract key info from: John Doe, 30 years old, lives in NYC\"}],\n    \"response_format\": {\n      \"type\": \"json_schema\",\n      \"json_schema\": {\n        \"name\": \"person_info\",\n        \"schema\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"name\": {\"type\": \"string\"},\n            \"age\": {\"type\": \"integer\"},\n            \"city\": {\"type\": \"string\"}\n          },\n          \"required\": [\"name\", \"age\", \"city\"]\n        }\n      }\n    }\n  }\n}\n\n\nBenefits:\n\nGuaranteed schema compliance\nNo missing required keys\nNo hallucinated enum values\nSeamless OpenAI compatibility\nautobatcher: Automatic Batching\n\nautobatcher is a Python client that automatically converts individual API calls into batched requests, reducing costs without code changes.\n\nInstallation:\n\npip install autobatcher\n\n\nHow it works:\n\nCollection Phase: Requests accumulate during a time window (default: 1 second) or until batch size threshold\nBatch Submission: Collected requests are submitted together\nResult Polling: System monitors for completed responses\nTransparent Response: Your code receives standard ChatCompletion responses\n\nKey benefit: Significant cost reduction through automatic batching while writing normal async code using the familiar OpenAI interface.\n\nDocumentation: https://github.com/doublewordai/autobatcher\n\nAdditional Operations\nList All Batches\n\nVia API:\n\ncurl https://api.doubleword.ai/v1/batches?limit=10 \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\"\n\n\nVia Console: View all batches in the dashboard.\n\nCancel Batch\n\nVia API:\n\ncurl https://api.doubleword.ai/v1/batches/batch-xyz789/cancel \\\n  -X POST \\\n  -H \"Authorization: Bearer $DOUBLEWORD_API_KEY\"\n\n\nVia Console: Click cancel in the batch details view.\n\nNotes:\n\nUnprocessed requests are cancelled\nAlready-processed results remain downloadable\nOnly charged for completed work\nCannot cancel completed batches\nCommon Patterns\nProcessing Results\n\nParse JSONL output line-by-line:\n\nimport json\n\nwith open('results.jsonl') as f:\n    for line in f:\n        result = json.loads(line)\n        custom_id = result['custom_id']\n        content = result['response']['body']['choices'][0]['message']['content']\n        print(f\"{custom_id}: {content}\")\n\nHandling Partial Results\n\nCheck for incomplete batches and resume:\n\nimport requests\n\nresponse = requests.get(\n    'https://api.doubleword.ai/v1/files/file-output123/content',\n    headers={'Authorization': f'Bearer {api_key}'}\n)\n\nif response.headers.get('X-Incomplete') == 'true':\n    last_line = int(response.headers.get('X-Last-Line', 0))\n    print(f\"Batch incomplete. Processed {last_line} requests so far.\")\n    # Continue polling and download again later\n\nRetry Failed Requests\n\nExtract failed requests from error file and resubmit:\n\nimport json\n\nfailed_ids = []\nwith open('errors.jsonl') as f:\n    for line in f:\n        error = json.loads(line)\n        failed_ids.append(error['custom_id'])\n\nprint(f\"Failed requests: {failed_ids}\")\n# Create new batch with only failed requests\n\nProcessing Tool Calls\n\nHandle tool call responses:\n\nimport json\n\nwith open('results.jsonl') as f:\n    for line in f:\n        result = json.loads(line)\n        message = result['response']['body']['choices'][0]['message']\n\n        if message.get('tool_calls'):\n            for tool_call in message['tool_calls']:\n                print(f\"Tool: {tool_call['function']['name']}\")\n                print(f\"Args: {tool_call['function']['arguments']}\")\n\nBest Practices\n\nDescriptive custom_ids: Include context in IDs for easier result mapping\n\nGood: \"user-123-question-5\", \"dataset-A-row-42\"\nBad: \"1\", \"req1\"\n\nValidate JSONL locally: Ensure each line is valid JSON with no internal line breaks before upload\n\nNo duplicate IDs: Each custom_id must be unique within the batch\n\nSplit large files: Keep under 200MB limit by splitting into multiple batches\n\nChoose appropriate window: Use 24h for cost savings (50-83% cheaper), 1h only when time-sensitive\n\nHandle errors gracefully: Always check error_file_id and retry failed requests\n\nMonitor request_counts: Track progress via completed/total ratio\n\nSave file IDs: Store batch_id, input_file_id, output_file_id for later retrieval\n\nUse cost estimator: Preview expenses in console before submitting large batches\n\nConsider autobatcher: For ongoing workloads, use autobatcher to automatically batch individual API calls\n\nReference Documentation\n\nFor complete API details, see:\n\nAPI Reference: references/api_reference.md - Full endpoint documentation and schemas\nGetting Started Guide: references/getting_started.md - Detailed setup and account management\nPricing Details: references/pricing.md - Model costs and SLA comparison"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/pjb157/doubleword",
    "publisherUrl": "https://clawhub.ai/pjb157/doubleword",
    "owner": "pjb157",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/doubleword",
    "downloadUrl": "https://openagent3.xyz/downloads/doubleword",
    "agentUrl": "https://openagent3.xyz/skills/doubleword/agent",
    "manifestUrl": "https://openagent3.xyz/skills/doubleword/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/doubleword/agent.md"
  }
}