SWP Documentation & Guides

Symbol Word Protocol - Transform Documents for AI Understanding

What is the Symbol Word Protocol?

The Symbol Word Protocol (SWP) is a structured tagging system designed to make documents more understandable to AI systems. By adding semantic tags to your content, you help Large Language Models (LLMs) like ChatGPT, Claude, and other AI assistants process your documents with greater accuracy, consistency, and context awareness.

Why SWP Matters

AI systems work best when they understand the structure and intent of content. SWP provides:

  • Explicit Structure: Tags tell AI exactly what each section represents
  • Reduced Ambiguity: Clear metadata prevents misinterpretation
  • Consistent Processing: Same document structure yields consistent AI responses
  • Domain Context: Industry-specific tags add regulatory and compliance awareness

What's New

Recent platform enhancements expanding SWP capabilities for developers and enterprises:

Official SDKs
Python (pip install ideaphase) and JavaScript/TypeScript (npm install ideaphase) client libraries with full API coverage
V2 API
Enhanced response format with request IDs, rate limit headers, and structured error codes. V1 remains stable and backward-compatible
Agent-to-Agent Proof Sharing
Share and cross-reference proof receipts between different API keys for multi-agent verification chains
Webhook Notifications
HMAC-signed real-time callbacks for proof.created, chain.verified, proof.shared, and proof.cross_referenced events
SWP Playground
A/B evaluation tool comparing raw vs SWP-enhanced AI output across OpenAI, Anthropic, and Google models
Public Status Page
Live system health dashboard at /status with uptime metrics and response time charts
Health & Discovery API
GET /api/health for component-level status monitoring and GET /api/v1/discovery for automatic endpoint catalog. No authentication required
SWP Support Chat
AI-powered self-service support at /support with knowledge of SWP protocol, API usage, and troubleshooting
Docs Shortcut
GET /docs redirects to this documentation portal for convenience. Use either /docs or /swp-docs to access these guides

Core SWP Tags

These tags are applied to every document, regardless of which framework you choose:

@phase:
Development stage indicating where a document is in its lifecycle
@weight:
Complexity score (1-10) based on content depth and technical detail
@symbolic_id:
Unique identifier for cross-referencing and traceability
@swp_sum:
Cryptographic checksum for content integrity verification
@priority:
Urgency level: Critical, High, Medium, Low
@category:
Content type: Strategic, Operational, Technical, Creative
// Example: Tagged project document @phase: 3.2 - Design - Technical Specs @weight: 7 @symbolic_id: 12 @swp_sum: 48291 @priority: High @category: Technical @status: In Progress @project_type: Enterprise // Your document content follows...

Free vs Pro Features

Feature Free Tier FREE Pro Plan PRO
Single-file SWP tagging Unlimited Unlimited
Core SWP tags All tags All tags
Document proof generation Yes Yes
Batch processing (multi-file) - 180/month
Domain frameworks - All 7 frameworks
GPT Idea Builder - 180/month
Document Refinement - 180/month
SWP Playground (A/B evaluation) - Yes (10 platform GPT/month + BYO key)
Usage Dashboard - Yes
API Access (V1 + V2) - Yes (via API keys)
Webhook Notifications - Yes (HMAC-signed)
Agent-to-Agent Proof Sharing - Yes
Official SDKs (Python & JS) Available (requires Pro API key)
Tip: The free tier is perfect for individual documents, journaling, and learning the SWP system. Upgrade to Pro when you need batch processing for projects or industry-specific compliance tags.

Using SWP with AI Systems

SWP-tagged documents work seamlessly with AI assistants. Here's how to leverage them:

With ChatGPT / Claude

Example Prompt

"I'm providing an SWP-tagged document. Please read the metadata tags at the top to understand the context, development phase, and priority before responding to my questions."

With AI-Powered IDEs (Cursor, Replit, etc.)

Include SWP-tagged requirements and specifications in your project. The AI will use the phase and priority tags to understand which features to prioritize.

With Note-Taking / Journal Apps

Tag your notes and journal entries to create searchable, structured content. The @category and @status tags help you track progress on ideas over time.

// Journal entry with SWP tags @phase: 1.1 - Ideation - Brainstorm @category: Creative @status: Draft @priority: Medium ## Business Idea: Subscription Box for Pet Owners Today I had an idea for a monthly subscription...

General Framework FREE

The General framework applies standard SWP tags suitable for any document type. It's the default framework and is available to all users, including free tier.

Best Use Cases

  • Project Documentation: PRDs, specifications, requirements
  • Personal Notes: Journals, idea logs, research notes
  • Business Documents: Proposals, reports, presentations
  • Creative Writing: Story outlines, character notes, world-building
  • Technical Documentation: API docs, user guides, tutorials

Extended Optional Tags

Enable "Show Extended Tags" to access additional metadata options:

@project_type:
MVP, Enterprise, Startup, Personal, Research
@use_case:
Specific application context
@target_audience:
Developers, Executives, End Users, etc.
@milestone:
MVP Launch, Beta Release, Alpha Demo
@risk_level:
Low, Moderate, High, Critical
@timeline:
Target completion timeframe

Example: Tagged Project Proposal

@phase: 2.1 - Research - Market Analysis @weight: 5 @symbolic_id: 8 @swp_sum: 31847 @priority: High @category: Strategic @status: In Review @project_type: Startup @target_audience: Investors @milestone: Seed Round @timeline: Q2 2026 ## Mobile App Proposal: FitTrack Pro ### Executive Summary FitTrack Pro is a fitness tracking application...

Healthcare & Clinical Framework PRO

HIPAA/GDPR compliant tagging for medical documentation, clinical workflows, and healthcare technology

Framework Tags

These 7 compliance tags are automatically applied when using the Healthcare framework:

@sector: Healthcare
Identifies the document as healthcare domain
@regulatory_standards: HIPAA, GDPR
Applicable data protection regulations
@compliance_posture: PHI Protection
Protected Health Information handling requirements
@data_sensitivity: Patient Data, Clinical Records
Data classification for healthcare
@audit_trail: Required
Logging and audit requirements for compliance
@data_minimization: Required
Collect only necessary data principle
@operational_principles: Need-to-Know Access, Encryption at Rest
Security and access control guidelines

Best Use Cases

  • Electronic Health Records (EHR): Patient record templates, clinical notes
  • Clinical Decision Support: Treatment protocols, diagnostic workflows
  • Healthcare Analytics: Population health reports, outcome tracking
  • Telehealth Platforms: Virtual visit documentation, remote monitoring
  • Medical Device Documentation: Device specs for FDA compliance

Example: Clinical Protocol Document

@phase: 4.2 - Core - Implementation @weight: 8 @priority: Critical @category: Operational @sector: Healthcare @regulatory_standards: HIPAA, GDPR @compliance_posture: PHI Protection @data_sensitivity: Patient Data, Clinical Records @audit_trail: Required @data_minimization: Required @operational_principles: Need-to-Know Access, Encryption at Rest ## Diabetes Management Protocol v2.1 ### Patient Eligibility Criteria Type 2 diabetes diagnosis confirmed via HbA1c > 6.5%...
Compliance Note: These tags signal to AI systems that the document contains sensitive healthcare data. LLMs should apply appropriate caution and not store or transmit PHI inappropriately.

Robotics & Autonomous Systems PRO

ISO 13482 / IEC 61508 compliant tagging for safety-critical systems and autonomous technology

Framework Tags

These 7 safety-focused tags are automatically applied when using the Robotics framework:

@sector: Robotics
Identifies the document as robotics/autonomous domain
@regulatory_standards: ISO 13482, IEC 61508
Safety and functional safety standards
@compliance_posture: Safety-Critical Controls
High-reliability system requirements
@data_sensitivity: Sensor Data, Control Systems
Data classification for autonomous systems
@fail_safe_protocol: Required
Graceful degradation and emergency stop requirements
@real_time_processing: Required
Latency-critical processing constraints
@operational_principles: Redundancy, Human Override, Graceful Degradation
Safety design principles

Best Use Cases

  • Autonomous Vehicles: Navigation specs, sensor fusion docs, safety cases
  • Industrial Robotics: Manufacturing automation, collaborative robot specs
  • Drone Systems: Flight control, obstacle avoidance, geofencing
  • Medical Robotics: Surgical robot requirements, safety interlocks
  • Warehouse Automation: AGV navigation, pick-and-place systems

Example: Autonomous Navigation Specification

@phase: 3.1 - Design - Architecture @weight: 9 @priority: Critical @category: Technical @sector: Robotics @regulatory_standards: ISO 13482, IEC 61508 @compliance_posture: Safety-Critical Controls @data_sensitivity: Sensor Data, Control Systems @fail_safe_protocol: Required @real_time_processing: Required @operational_principles: Redundancy, Human Override, Graceful Degradation ## LiDAR-Based Obstacle Avoidance System ### Safety Requirements The system shall detect obstacles within 50m range... Emergency stop activation within 100ms of detection...
Safety Note: These tags indicate safety-critical documentation. AI systems processing this content should flag any ambiguity in safety requirements and never suggest shortcuts that compromise fail-safe mechanisms.

Education Technology Framework PRO

FERPA/COPPA compliant tagging for learning platforms, student data protection, and curriculum alignment

Framework Tags

These 7 education compliance tags are automatically applied when using the Education framework:

@sector: Education
Identifies the document as education domain
@regulatory_standards: FERPA, COPPA, GDPR
Student privacy and children's data protection
@compliance_posture: Student Data Protection
Core educational privacy requirement
@data_sensitivity: Student Records, Learning Analytics
Data classification for education
@accessibility: WCAG 2.1 AA Required
Inclusive education accessibility standards
@content_standards: Common Core, NGSS, State Standards
Curriculum alignment frameworks
@operational_principles: Age-Appropriate Design, Parental Consent, Data Minimization
EdTech ethical guidelines

Best Use Cases

  • Learning Management Systems (LMS): Course structures, assignment specs, gradebook designs
  • Curriculum Mapping: Standards alignment, lesson plans, scope and sequence
  • Assessment Platforms: Test specifications, rubrics, adaptive learning algorithms
  • Student Information Systems: Enrollment workflows, transcript management
  • Educational Analytics: Learning outcome tracking, intervention triggers

Example: LMS Course Specification

@phase: 3.2 - Design - Technical Specs @weight: 6 @priority: High @category: Operational @sector: Education @regulatory_standards: FERPA, COPPA, GDPR @compliance_posture: Student Data Protection @data_sensitivity: Student Records, Learning Analytics @accessibility: WCAG 2.1 AA Required @content_standards: Common Core, NGSS, State Standards @operational_principles: Age-Appropriate Design, Parental Consent, Data Minimization ## Algebra I Course Module: Linear Equations ### Learning Objectives (CCSS.MATH.CONTENT.HSA.REI.B.3) Students will be able to solve linear equations in one variable...
Privacy Note: Documents tagged with the Education framework indicate student data involvement. AI systems should never store, share, or process student PII beyond the immediate task, and must respect parental consent requirements for users under 13.

Financial Services Framework PRO

SOX/FINRA/Basel III compliant tagging for trading systems, risk management, and regulatory reporting

Framework Tags

These 7 financial compliance tags are automatically applied when using the Finance framework:

@sector: Financial Services
Identifies the document as financial domain
@regulatory_standards: SOX, GDPR, FINRA, Basel III, PCI-DSS
Financial regulations and compliance frameworks
@compliance_posture: Financial Controls Required
Core financial control requirement
@data_sensitivity: PII, Transaction Data, Account Information
Data classification for financial records
@audit_trail: Required
Mandatory transaction logging for compliance
@risk_classification: Required
Risk categorization for financial instruments
@operational_principles: Data Encryption, Immutable Logs, Non-Repudiation
Financial security best practices

Best Use Cases

  • Account Statements: Monthly statements, transaction summaries, balance reports
  • Transaction Processing: Payment workflows, transfer validation, settlement systems
  • Risk Management: Risk assessments, exposure analysis, hedging strategies
  • Regulatory Reporting: SOX compliance docs, FINRA filings, Basel III capital reports
  • Portfolio Management: Investment strategies, asset allocation, performance tracking
  • Compliance Automation: Policy enforcement, audit preparation, control monitoring
  • Treasury Operations: Cash management, liquidity planning, funding strategies

Example: Account Statement

@phase: 2.1 - Blueprint - System Architecture @weight: 5 @priority: Medium @category: Financial Reporting @sector: Financial Services @regulatory_standards: SOX, GDPR, FINRA, Basel III, PCI-DSS @compliance_posture: Financial Controls Required @data_sensitivity: PII, Transaction Data, Account Information @audit_trail: Required @risk_classification: Required @operational_principles: Data Encryption, Immutable Logs, Non-Repudiation ## Account Statement - March 2025 ### Account Details Account Number: 123-456-789 Customer: Jane Doe Period: 01-Mar-2025 - 31-Mar-2025
Compliance Note: Documents tagged with the Finance framework indicate financial data handling requirements. AI systems should enforce data encryption, maintain immutable audit logs, and ensure non-repudiation for all transactions. Never process or store unencrypted financial PII.

AI-Agent Workflows & Marketing Framework PRO

The AI-Agent Workflows framework provides structured tagging for multi-agent orchestration, task automation, and marketing workflows. This framework is designed for the web3 community, AI automation platforms, and autonomous systems where multiple agents collaborate on complex tasks.

Why SWP for Agent Workflows? Generic tags without SWP logic create ambiguity. SWP acts as a "UUID/SHA-256 equivalent" for agent workflows - providing deterministic structure that ensures consistent agent behavior, proper handoffs, and auditable decision chains.

Framework Tags

These 8 agent workflow tags are automatically applied when using the AI-Agent Workflows framework:

@sector: AI-Agent Workflows
Identifies the document as AI-Agent automation domain
@agent_role: [Orchestrator, Executor, Validator]
Specialized function of each AI agent in the workflow
@task_sequence: [Ordered Steps]
Ordered chain of operations the agent must execute
@handoff_trigger: [Condition]
Conditions for transfer to next agent or human
@context_window: [Scope]
Required context and memory scope for decisions
@fallback_protocol: [Recovery Plan]
Error handling and recovery procedures
@output_schema: [Format]
Structured format for agent responses
@operational_principles: Deterministic Execution, Auditable Decisions, Human-in-Loop
Core principles for reliable agent behavior

Best Use Cases

  • Multi-Agent Orchestration: Coordinate multiple specialized AI agents in complex workflows
  • Marketing Automation Pipelines: Structured email sequences, content calendars, campaign management
  • Content Generation Workflows: Research, Draft, Edit, Publish chains with quality gates
  • Lead Nurturing Sequences: Automated follow-up sequences with conditional branching
  • Customer Support Bots: Ticket routing, response generation, escalation protocols
  • Web3 DAO Automation: Governance proposals, voting workflows, treasury management
  • Social Media Management: Cross-platform posting, engagement tracking, response automation
  • Sales Funnel Automation: Lead qualification, outreach sequences, CRM integration

Extended Entity & Role Types

The Agent Workflow framework includes specialized types for multi-agent systems:

  • Entity Types: agent, task, workflow, campaign, lead
  • Role Types: orchestrator, executor, validator, reviewer, human_operator
  • Document Types: prompt, template, response, log, report
  • Domain Types: marketing, sales, support, content, web3

Example: Marketing Content Workflow

@phase: 2.1 - Blueprint - System Architecture @weight: 4 @priority: High @category: Content Generation @sector: AI-Agent Workflows @agent_role: Content Writer @task_sequence: 1. Research topic 2. Create outline 3. Draft content 4. Submit for review @handoff_trigger: Draft complete OR word_count > 1500 OR errors_detected @context_window: Previous 3 articles, brand guidelines, SEO keywords @fallback_protocol: Escalate to human editor if confidence < 0.7 @output_schema: JSON: {title, body, meta_description, tags[]} @operational_principles: Deterministic Execution, Auditable Decisions, Human-in-Loop Options ## Blog Post Generation Task ### Agent Assignment Primary Agent: ContentWriterBot-v3 Validation Agent: QualityReviewBot Human Fallback: content-team@company.com
Agent Workflow Note: Documents tagged with the Agent Workflow framework provide explicit structure for AI orchestration. Unlike generic tagging attempts, SWP ensures agents understand their role boundaries, task sequences, and handoff conditions - reducing ambiguity and improving multi-agent coordination.

Official SDKs

IdeaPhase provides official client libraries for Python and JavaScript/TypeScript. Both SDKs wrap the full API with clean, idiomatic interfaces — encode documents, manage proofs, register webhooks, and share proofs between agents with just a few lines of code.

Prerequisite: Both SDKs require a Pro API key. Create one from the API Key Management section on the main page (requires an active Pro subscription).

Python SDK

Installation

pip install ideaphase

Quick Start

# Initialize the client from ideaphase import IdeaPhase client = IdeaPhase(api_key="swp_your_api_key_here") # Encode a document result = client.encode( "Design a patient intake system for emergency departments.", framework="healthcare" ) print(result["tagged_document"]["full_text"]) print(f"Proof hash: {result['proof']['proof_hash']}") print(f"Chain position: {result['proof']['chain_position']}")

Batch Encoding

# Encode up to 20 documents in a single call batch_result = client.encode_batch([ {"text": "Patient vital signs monitoring protocol.", "framework": "healthcare"}, {"text": "Autonomous drone navigation safety spec.", "framework": "robotics"}, {"text": "Software licensing agreement template.", "framework": "legal"} ]) for item in batch_result["results"]: print(f"Framework: {item['metadata']['framework']}") print(f"Proof: {item['proof']['proof_hash']}")

Proof Verification

# Verify a single proof (public, no auth needed) verification = client.verify_proof("a1b2c3d4e5f6...64_char_hex...") print(f"Valid: {verification['verified']}") # Verify entire proof chain integrity chain = client.verify_chain("swp_a1b2") print(f"Chain valid: {chain['valid']}, Length: {chain['chain_length']}") # Download a full proof receipt receipt = client.get_proof("d4e5f6a7-b8c9-1234-5678-9abcdef01234") print(f"Receipt type: {receipt['receipt_type']}")

Webhooks

# Register a webhook webhook = client.webhooks.create( url="https://your-app.com/webhooks/swp", events=["proof.created", "chain.verified"] ) print(f"Webhook ID: {webhook['id']}") print(f"Secret: {webhook['secret']}") # Store this for HMAC verification # List all webhooks webhooks = client.webhooks.list() # Remove a webhook client.webhooks.delete(webhook["id"])

Error Handling

from ideaphase import IdeaPhase, AuthenticationError, RateLimitError, IdeaPhaseError client = IdeaPhase(api_key="swp_your_key") try: result = client.encode("Your text here") except AuthenticationError: print("Invalid or expired API key") except RateLimitError: print("Rate limit exceeded - wait and retry") except IdeaPhaseError as e: print(f"API error: {e}")

Custom Base URL

# Point to a different IdeaPhase instance client = IdeaPhase( api_key="swp_your_key", base_url="https://your-ideaphase-instance.com", timeout=60 # Request timeout in seconds (default: 30) )

JavaScript / TypeScript SDK

Installation

npm install ideaphase

Quick Start

// Initialize the client import { IdeaPhase } from "ideaphase"; const client = new IdeaPhase({ apiKey: "swp_your_api_key_here" }); // Encode a document const result = await client.encode( "Deploy autonomous navigation module v2.3 with LIDAR failover.", { framework: "robotics" } ); console.log(result.tagged_document.full_text); console.log(`Proof: ${result.proof.proof_hash}`); console.log(`Chain #${result.proof.chain_position}`);

Batch Encoding

// Encode up to 20 documents in a single call const batchResult = await client.encodeBatch([ { text: "Patient vital signs monitoring protocol.", framework: "healthcare" }, { text: "Q3 portfolio rebalancing required.", framework: "finance" }, { text: "Contract clause amendment for Section 4.2.", framework: "legal" } ]); for (const item of batchResult.results) { console.log(`Framework: ${item.metadata.framework}`); console.log(`Proof: ${item.proof.proof_hash}`); }

Proof Verification & Webhooks

// Verify a proof const verification = await client.verifyProof("a1b2c3d4e5f6..."); console.log(`Valid: ${verification.verified}`); // Verify chain integrity const chain = await client.verifyChain("swp_a1b2"); console.log(`Chain valid: ${chain.valid}, Length: ${chain.chain_length}`); // Register a webhook const webhook = await client.webhooks.create( "https://your-app.com/webhooks/swp", ["proof.created", "proof.shared"] ); console.log(`Secret: ${webhook.secret}`);

TypeScript Types

The SDK exports full TypeScript type definitions for all API responses:

import type { EncodeResponse, BatchEncodeResponse, ProofVerifyResponse, ChainVerifyResponse, ProofReceipt, Webhook } from "ideaphase"; // All responses are fully typed const result: EncodeResponse = await client.encode("Your text"); const tags = result.tagged_document.core_tags; // { phase, weight, symbolic_id, swp_sum }

Error Handling

import { IdeaPhase, AuthenticationError, RateLimitError, IdeaPhaseError } from "ideaphase"; try { const result = await client.encode("Your text here"); } catch (error) { if (error instanceof AuthenticationError) { console.error("Invalid or expired API key"); } else if (error instanceof RateLimitError) { console.error("Rate limit exceeded - wait and retry"); } else if (error instanceof IdeaPhaseError) { console.error(`API error (${error.statusCode}): ${error.message}`); } }

SDK → API Endpoint Mapping

Python SDK MethodJS/TS SDK MethodAPI Endpoint
client.encode(text, framework)client.encode(text, opts)POST /api/v1/encode
client.encode_batch(items)client.encodeBatch(items)POST /api/v1/encode/batch
client.verify_proof(hash)client.verifyProof(hash)GET /api/v1/proof/verify/{hash}
client.verify_chain(prefix)client.verifyChain(prefix)GET /api/v1/proof/chain/{prefix}/verify
client.get_proof(doc_id)client.getProof(docId)GET /api/v1/proof/{doc_id}/receipt
client.webhooks.create(url, events)client.webhooks.create(url, events)POST /api/v1/webhooks
client.webhooks.list()client.webhooks.list()GET /api/v1/webhooks
client.webhooks.delete(id)client.webhooks.delete(id)DELETE /api/v1/webhooks/{id}
Source Code: Python SDK is in sdk/python/ and JavaScript/TypeScript SDK is in sdk/js/. Both use the same API endpoints and authentication scheme (Bearer token).

Getting Started

The IdeaPhase SWP Encoding API lets you programmatically encode documents with Symbol Word Protocol tags. Every request returns structured, AI-readable output with prompt templates, LoRA fine-tuning guidance, and a cryptographic proof chain for verifiable document lineage.

Base URL

https://ideaphase.app
Quick Access: You can reach this documentation at either /swp-docs or /docs (which redirects here). For a machine-readable catalog of all available endpoints, see GET /api/v1/discovery.

Prerequisites

  1. Active Pro Subscription — Sign up at ideaphase.app and upgrade to Pro ($29.99/month)
  2. API Key — Create one from the API Key Management section on the home page, or use the /api/v1/key/create endpoint
Important: Your full API key is shown only once at creation. Store it securely — IdeaPhase stores only a SHA-256 hash and cannot recover your key.

Quick Start (cURL)

# Encode a document with SWP tags curl -X POST https://ideaphase.app/api/v1/encode \ -H "Authorization: Bearer swp_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "text": "Our AI assistant must respond within 200ms and fall back to cached responses if the primary model is unavailable.", "framework": "general" }'

Authentication

All API requests require a Bearer token in the Authorization header. Your API key starts with swp_ followed by a unique token.

Header Format

Authorization: Bearer swp_your_api_key_here

Authentication Errors

// Missing or malformed header { "error": "Missing or invalid Authorization header. Use: Bearer <your_api_key>" } // Invalid key { "error": "Invalid API key" } // Daily limit exceeded { "error": "Daily API limit exceeded", "limit": 100 }

Encode Endpoint

The core endpoint that transforms raw text into SWP-tagged, AI-readable output.

POST /api/v1/encode

Request Body (JSON)

FieldTypeRequiredDescription
textstringYesThe raw text content to encode (1–50,000 characters)
frameworkstringNoDomain framework: general (default), healthcare, robotics, legal, education, finance, agent_workflow
include_extended_tagsbooleanNoInclude optional extended tags (default: true)

Example Request

curl -X POST https://ideaphase.app/api/v1/encode \ -H "Authorization: Bearer swp_abc123..." \ -H "Content-Type: application/json" \ -d '{ "text": "The patient presents with elevated troponin levels indicating possible myocardial infarction. Immediate cardiac catheterization is recommended per ACC/AHA guidelines.", "framework": "healthcare", "include_extended_tags": true }'

Example Response (200 OK)

{ "swp_version": "1.0", "encoding_id": "a3f8b2c1e9d04712", "tagged_document": { "full_text": "@phase: Execution\n@weight: 0.92\n@symbolic_id: SWP-EXE-001\n@swp_sum: Clinical assessment...\n@sector: Healthcare\n@regulatory_standards: HIPAA, HITECH\n@compliance_posture: Active\n@data_sensitivity: PHI\n@audit_trail: Required\n@data_minimization: Applied\n@operational_principles: Patient Safety First\n\nThe patient presents with...", "core_tags": { "phase": "Execution", "weight": 0.92, "symbolic_id": "SWP-EXE-001", "swp_sum": "Clinical assessment with cardiac emergency protocol..." }, "extended_tags": { "priority": "critical", "confidence": "high", "source_type": "clinical_note" }, "domain_tags": { "sector": "Healthcare", "regulatory_standards": "HIPAA, HITECH", "compliance_posture": "Active", "data_sensitivity": "PHI", "audit_trail": "Required", "data_minimization": "Applied", "operational_principles": "Patient Safety First" } }, "prompt_template": "You are processing an SWP-tagged document. Read the @phase and @weight tags first to understand priority and classification. The @symbolic_id provides a unique reference. Process the content according to the indicated phase and regulatory framework...", "lora_guidance": { "task_type": "classification_and_tagging", "recommended_base_model": "llama-3-8b or mistral-7b", "training_format": "instruction_following", "suggested_hyperparameters": { ... } }, "proof": { "document_id": "d4e5f6a7-b8c9-1234-5678-9abcdef01234", "proof_hash": "a1b2c3d4e5f6...64-char-sha256-hex...", "chain_position": 7, "previous_proof_hash": "f9e8d7c6b5a4...previous-sha256-hex...", "timestamp": "2026-02-16T14:32:01+00:00", "receipt_url": "/api/v1/proof/d4e5f6a7-b8c9-1234-5678-9abcdef01234" }, "metadata": { "processing_time_ms": 12.45, "tag_count": 14, "framework": "healthcare", "input_length": 198, "word_count": 24, "input_hash": "c7d8e9f0a1b2...64-char-sha256-hex...", "encoded_at": "2026-02-16T14:32:01+00:00" } }

Response Fields Explained

FieldDescription
swp_versionProtocol version used for encoding
encoding_idUnique identifier for this encoding operation
tagged_document.full_textComplete tagged document with SWP headers prepended to your content
tagged_document.core_tagsThe four required SWP tags: phase, weight, symbolic_id, swp_sum
tagged_document.extended_tagsOptional tags like priority, confidence, source_type (null if disabled)
tagged_document.domain_tagsFramework-specific compliance tags (null if using general framework)
prompt_templateReady-to-use system prompt instructing LLMs how to interpret the tags
lora_guidanceRecommended settings for fine-tuning models on SWP-tagged data
proofCryptographic proof chain entry (see Proof Chain section below)
metadataProcessing statistics: timing, tag count, framework used

Domain Frameworks

Pass a framework parameter to apply industry-specific compliance tags. Each framework adds regulatory and sector tags alongside the core SWP tags.

Framework IDSectorKey Compliance Tags
generalAnyCore SWP tags only (default)
healthcareHealthcare & ClinicalHIPAA, HITECH, PHI sensitivity, audit trail
roboticsRobotics & AutonomousISO 13482, IEC 61508, fail-safe protocols
legalLegal TechnologyGDPR, CCPA, document integrity, audit trail
educationEducation TechnologyFERPA, COPPA, accessibility, content standards
financeFinancial ServicesSOX, FINRA, Basel III, PCI-DSS, risk classification
agent_workflowAI-Agent WorkflowsAgent roles, task sequences, handoff triggers, fallback protocols

Example: Encoding with Finance Framework

curl -X POST https://ideaphase.app/api/v1/encode \ -H "Authorization: Bearer swp_abc123..." \ -H "Content-Type: application/json" \ -d '{ "text": "Q3 portfolio rebalancing required. Client exposure to emerging markets exceeds 15% allocation target. Recommend gradual reduction over 30-day window to minimize market impact.", "framework": "finance" }' // The domain_tags in the response will include: "domain_tags": { "sector": "Financial Services", "regulatory_standards": "SOX, FINRA, Basel III, PCI-DSS", "compliance_posture": "Active", "data_sensitivity": "Confidential", "audit_trail": "Required", "risk_classification": "Medium", "operational_principles": "Fiduciary Duty, Regulatory Compliance" }

API Key Management

Pro subscribers can create up to 5 API keys. Keys are prefixed with swp_ and stored as SHA-256 hashes — the full key is shown only at creation.

POST /api/v1/key/create

Create a new API key. Requires an active Pro session (cookie-based auth from the web app).

Request Body

FieldTypeRequiredDescription
labelstringNoFriendly name for the key (default: "API Key")

Example Response (201 Created)

{ "api_key": "swp_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6", "key_id": 42, "prefix": "swp_a1b2", "label": "Production Key", "created_at": "2026-02-16T14:00:00+00:00", "rate_limit_per_minute": 10, "daily_limit": 100, "note": "Store this key securely. It cannot be retrieved again." }

GET /api/v1/key/list

List all your API keys with usage statistics. Requires an active session.

Example Response (200 OK)

{ "keys": [ { "id": 42, "prefix": "swp_a1b2", "label": "Production Key", "is_active": true, "requests_today": 23, "requests_total": 1547, "daily_limit": 100, "rate_limit_per_minute": 10, "last_used_at": "2026-02-16T13:45:22+00:00", "created_at": "2026-01-15T09:00:00+00:00" } ] }

POST /api/v1/key/revoke

Permanently deactivate a compromised or unused key. Requires an active session.

Request Body

{ "key_id": 42 }

Example Response (200 OK)

{ "prefix": "swp_a1b2", "revoked": true }

POST /api/v1/key/rotate

Atomically revoke an old key and create a new one. Requires an active Pro session.

Request Body

{ "key_id": 42, "label": "Rotated Production Key" }

Example Response (200 OK)

{ "api_key": "swp_x9y8z7w6v5u4t3s2r1q0...", "key_id": 43, "prefix": "swp_x9y8", "label": "Rotated Production Key", "old_prefix": "swp_a1b2", "created_at": "2026-02-16T15:00:00+00:00", "note": "Old key has been revoked. Store the new key securely." }

Proof Chain & Document Verification

Every document encoded through the API generates a SHA-256 cryptographic proof that chains to the previous proof for your API key. This creates a verifiable, tamper-proof record of every document you have encoded — without storing any raw content.

Privacy by Design: IdeaPhase stores only SHA-256 hashes of your input and output — never the actual document content. This makes the proof chain GDPR and HIPAA compliant while still providing strong evidence of document existence and processing time.

How the Proof Chain Works

  1. You send a document to /api/v1/encode
  2. IdeaPhase generates SHA-256 hashes of both the input and output
  3. A combined proof_hash is created from input_hash + output_hash + timestamp
  4. This proof is linked to your previous proof via previous_proof_hash, forming a chain
  5. The response includes a proof object with the document_id, proof_hash, and chain position

Proof Object (included in every encode response)

"proof": { "document_id": "d4e5f6a7-b8c9-1234-5678-9abcdef01234", // UUID for this document "proof_hash": "a1b2c3d4e5f6...", // 64-char SHA-256 hex "chain_position": 7, // Position in your proof chain "previous_proof_hash": "f9e8d7c6b5a4...", // Link to previous proof (null if first) "timestamp": "2026-02-16T14:32:01+00:00", // UTC processing time "receipt_url": "/api/v1/proof/d4e5f6a7-b8c9-..." // Download full receipt }

GET /api/v1/proof/{document_id} AUTH

Download a full proof receipt for a specific document. Requires the API key that created the proof.

Example Request

curl -H "Authorization: Bearer swp_abc123..." \ https://ideaphase.app/api/v1/proof/d4e5f6a7-b8c9-1234-5678-9abcdef01234

Example Response (200 OK)

{ "receipt_type": "IdeaPhase API Encoding Proof", "version": "1.0", "generated_at": "2026-02-16T14:35:00+00:00", "document": { "document_id": "d4e5f6a7-b8c9-1234-5678-9abcdef01234", "proof_hash": "a1b2c3d4e5f6...", "input_hash": "e7f8a9b0c1d2...", "output_hash": "3c4d5e6f7a8b...", "processing_timestamp": "2026-02-16T14:32:01+00:00", "processing_type": "api_encode", "tier": "pro" }, "chain": { "previous_proof_hash": "f9e8d7c6b5a4...", "chain_position": 7, "api_key_prefix": "swp_a1b2" }, "framework": "healthcare", "verification": { "algorithm": "SHA-256", "encoding": "UTF-8", "normalization": "CRLF -> LF", "verify_url": "https://ideaphase.app/api/v1/proof/verify/a1b2c3d4e5f6...", "chain_verify_url": "https://ideaphase.app/api/v1/proof/chain/swp_a1b2/verify" }, "legal_notice": "This receipt provides cryptographic proof that the specified document was encoded through the IdeaPhase Symbol Word Protocol API at the indicated timestamp..." }

GET /api/v1/proof/verify/{proof_hash} PUBLIC

Verify that a proof exists and is valid. No authentication required — anyone can verify a proof hash.

Example Request

curl https://ideaphase.app/api/v1/proof/verify/a1b2c3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef

Example Response (200 OK)

{ "verified": true, "message": "Proof verified successfully", "document_id": "d4e5f6a7-b8c9-1234-5678-9abcdef01234", "created_at": "2026-02-16T14:32:01+00:00", "processing_type": "api_encode", "chain": { "has_chain": true, "chain_position": 7, "previous_proof_hash": "f9e8d7c6b5a4..." } }

GET /api/v1/proof/chain/{key_prefix}/verify PUBLIC

Verify the integrity of an entire proof chain for a given API key prefix. Detects broken links and tampered hashes.

Example Request

curl https://ideaphase.app/api/v1/proof/chain/swp_a1b2/verify

Example Response (200 OK)

{ "valid": true, "chain_length": 7, "first_proof": "b0a1c2d3e4f5...", "last_proof": "a1b2c3d4e5f6...", "first_timestamp": "2026-01-15T09:12:00+00:00", "last_timestamp": "2026-02-16T14:32:01+00:00", "errors": [] }
Use Case: Share the verify URL with clients, auditors, or legal teams as independent proof that a document was encoded at a specific time. The public verification endpoint requires no login — anyone with the proof hash can verify it.

Webhook Notifications

Pro users can register webhook URLs to receive real-time HTTP callbacks when events occur. Payloads are HMAC-signed with a per-webhook secret for tamper-proof verification.

Supported Events

proof.created
Fired when a document is encoded and a new proof is generated
chain.verified
Fired when a proof chain integrity check completes
proof.shared
Fired when a proof is shared via a share token
proof.cross_referenced
Fired when proofs from different agents are cross-referenced

POST /api/v1/webhooks AUTH

Register a new webhook endpoint.

Request Body

{ "url": "https://your-app.com/webhooks/swp", "events": ["proof.created", "chain.verified"] }

Response (201 Created)

{ "id": 1, "url": "https://your-app.com/webhooks/swp", "events": ["proof.created", "chain.verified"], "secret": "whsec_a1b2c3d4e5f6...", "is_active": true, "note": "Store the secret securely. Use it to verify webhook signatures." }

GET /api/v1/webhooks AUTH

List all registered webhooks for your account.

DELETE /api/v1/webhooks/{id} AUTH

Remove a webhook by ID.

Webhook Payload Format

Each webhook delivery includes an HMAC-SHA256 signature in the X-SWP-Signature header. Verify it using your webhook secret:

// Example payload for proof.created event { "event": "proof.created", "timestamp": "2026-03-01T14:32:01Z", "data": { "proof_hash": "a1b2c3d4e5f6...", "document_id": "d4e5f6a7-b8c9-...", "chain_position": 7, "framework": "healthcare" } }

Verifying Webhook Signatures (Python)

import hmac, hashlib def verify_webhook(payload_body, signature_header, webhook_secret): expected = hmac.new( webhook_secret.encode("utf-8"), payload_body, hashlib.sha256 ).hexdigest() return hmac.compare_digest(expected, signature_header)
Retry Policy: Failed webhook deliveries are retried up to 3 times with exponential backoff (1s, 4s, 16s delays). After 3 failures the delivery is abandoned. Ensure your endpoint returns a 2xx status code to acknowledge receipt.

Agent-to-Agent Proof Sharing

Enable cross-platform proof verification between different API keys. Agents can share proof receipts via time-limited tokens and create cross-reference links for multi-agent verification chains.

Sharing Workflow

  1. Agent A encodes a document and gets a proof hash
  2. Agent A calls /api/v1/proof/share to generate a shareable token
  3. Agent A sends the share token to Agent B (via API, message queue, etc.)
  4. Agent B calls /api/v1/proof/shared/{token} to verify the proof (public, no auth needed)
  5. Agent B optionally calls /api/v1/proof/cross-reference to link their own proof to Agent A's proof

POST /api/v1/proof/share AUTH

Generate a time-limited, HMAC-signed share token for a specific proof.

Request Body

FieldTypeRequiredDescription
document_idstringYesUUID of the document whose proof you want to share
expires_inintegerNoToken expiration in seconds (default: 604800 = 7 days)

Response (200 OK)

{ "share_token": "eyJkYXRhIjoi...", "expires_at": "2026-03-08T14:32:01+00:00", "proof_hash": "a1b2c3d4e5f6...", "verification_url": "https://ideaphase.app/api/v1/proof/shared/eyJkYXRhIjoi..." }

GET /api/v1/proof/shared/{share_token} PUBLIC

Verify a shared proof using its token. No authentication required — anyone with the token can verify the proof. Only hashes and metadata are returned, never the original content.

Response (200 OK)

{ "valid": true, "proof_hash": "a1b2c3d4e5f6...", "document_id": "d4e5f6a7-b8c9-...", "chain_position": 7, "input_hash": "e7f8a9b0c1d2...", "output_hash": "3c4d5e6f7a8b...", "framework": "healthcare", "timestamp": "2026-02-16T14:32:01+00:00", "shared_by": "swp_a1b2" }

POST /api/v1/proof/cross-reference AUTH

Create a cross-reference link between your proof and a shared proof from another agent. This creates a verifiable connection between proofs across different API keys.

Request Body

{ "source_proof_hash": "your_proof_hash_here...", "target_share_token": "eyJkYXRhIjoi..." }

Response (200 OK)

{ "cross_reference_id": 1, "source_proof_hash": "your_proof_hash...", "target_proof_hash": "their_proof_hash...", "target_key_prefix": "swp_x9y8", "created_at": "2026-03-01T15:00:00+00:00" }

GET /api/v1/proof/cross-references/{proof_hash} AUTH

List all cross-references linked to a specific proof (both directions).

Multi-Agent Use Case: In a pipeline where multiple AI agents process different stages of a document (e.g., Agent A does intake, Agent B does analysis, Agent C does compliance review), each agent creates its own proof. Cross-references link these proofs into a verifiable end-to-end audit trail across all agents.

V2 API Endpoints

The V2 API provides an enhanced response format with request IDs, rate limit headers, and structured error codes. V1 remains the stable, backward-compatible version and is not deprecated.

Version Strategy: V1 endpoints are locked and will continue to work indefinitely. V2 adds enhancements without breaking V1 consumers. You can also use V2 response format on V1 endpoints by sending the Accept-Version: v2 header.

V2 Response Enhancements

api_version
Response includes "api_version": "v2" field
request_id
Unique request identifier for tracing and support
X-RateLimit-Remaining
Response header showing remaining requests in current window
X-RateLimit-Reset
Response header with UTC timestamp when the limit resets
Structured Errors
Error responses include code and message fields inside an error object

POST /api/v2/encode AUTH

Same input as V1. Enhanced response with version metadata and rate limit info.

Request

curl -X POST https://ideaphase.app/api/v2/encode \ -H "Authorization: Bearer swp_abc123..." \ -H "Content-Type: application/json" \ -d '{"text": "Your document text here.", "framework": "general"}'

Response Headers

X-API-Version: 2.0 X-RateLimit-Remaining: 87 X-RateLimit-Reset: 2026-03-01T15:00:00Z

Response Body (200 OK)

{ "api_version": "v2", "request_id": "req_a1b2c3d4e5f6", "swp_version": "1.0", "encoding_id": "f7e8d9c0b1a2", "tagged_document": { ... }, "prompt_template": "...", "lora_guidance": { ... }, "metadata": { ... }, "proof": { ... } }

POST /api/v2/encode/batch AUTH

Same input as V1 batch. Enhanced response format with V2 metadata.

GET /api/v2/proof/verify/{proof_hash} PUBLIC

Verify a proof with V2 structured response format.

V2 Error Response Format

// V2 errors use structured codes { "api_version": "v2", "error": { "code": "RATE_LIMITED", "message": "Daily API limit exceeded (100/day)" } } // Other error codes: INVALID_AUTH, SUBSCRIPTION_REQUIRED, // MISSING_TEXT, INVALID_FRAMEWORK, TEXT_TOO_LONG, INVALID_FORMAT

Version Negotiation on V1 Endpoints

If you want V2 response format but want to keep using V1 URLs, add the Accept-Version: v2 header:

curl -X POST https://ideaphase.app/api/v1/encode \ -H "Authorization: Bearer swp_abc123..." \ -H "Accept-Version: v2" \ -H "Content-Type: application/json" \ -d '{"text": "Your text here.", "framework": "general"}' // Response will include api_version: "v2" fields // and X-RateLimit-* headers
Migration Path: Start with V1 for stability. When you need rate limit headers or request IDs for debugging, switch to V2 endpoints or add the Accept-Version: v2 header. Both versions use the same API keys and authentication.

Rate Limits & Quotas

API access is rate-limited to ensure fair usage across all clients.

Limit TypePro KeysFounder Keys
Requests per minute1010
Requests per day100500
Max keys per account5Unlimited
Max input text length50,000 characters

Rate Limit Response (429)

{ "error": "Daily API limit exceeded", "limit": 100 }

V2 Rate Limit Headers

V2 endpoints (and V1 endpoints with Accept-Version: v2) include rate limit information in the response headers:

X-RateLimit-Remaining: 87 // Requests left in current window X-RateLimit-Reset: 2026-03-01T15:00:00Z // When the limit resets (UTC)

Use these headers to implement client-side throttling and avoid hitting 429 errors.

Need higher limits? Contact ideaphase.needs@gmail.com to discuss enterprise plans with custom rate limits and SLA guarantees.

Error Reference

All errors return JSON with an error field. Common HTTP status codes:

StatusMeaningCommon Causes
400Bad RequestMissing text field, invalid framework name, text too long
401UnauthorizedMissing/invalid API key, expired key
403ForbiddenNo active Pro subscription, key revoked
404Not FoundInvalid document_id or proof_hash
429Rate LimitedExceeded per-minute or daily request quota
500Server ErrorInternal processing error (contact support)

Example Error Responses

// 400 - Missing text { "error": "Missing 'text' field in request body" } // 401 - Bad auth { "error": "Missing or invalid Authorization header. Use: Bearer <your_api_key>" } // 403 - No subscription { "error": "Active Pro subscription required to create API keys", "upgrade_url": "/api/create-checkout" } // 404 - Proof not found { "verified": false, "message": "No proof found with this hash" }

Security & Compliance

Key Security

  • SHA-256 Hashed Storage: API keys are hashed before storage. IdeaPhase cannot recover your key — store it securely at creation.
  • Key Prefix Identification: Each key has a visible prefix (e.g., swp_a1b2) for identification without exposing the full key.
  • Instant Revocation: Compromised keys can be revoked immediately via the web UI or API.
  • Key Rotation: Atomically replace a key without downtime — old key is revoked and new one is issued in a single operation.

Data Privacy

  • No Content Storage: Your document content is processed in memory and never persisted to the database.
  • Hash-Only Proofs: The proof chain stores only SHA-256 hashes (input_hash, output_hash, proof_hash) — never raw content.
  • GDPR/HIPAA Compliant: Hash-only architecture means no personally identifiable information or protected health information is stored.
  • HTTPS Only: All API traffic is encrypted in transit via TLS.

Audit Trail

  • Full Request Logging: Every API request is logged with timestamp, key prefix, endpoint, status code, and processing time.
  • Proof Chain Integrity: Tamper detection via chained SHA-256 hashes — any modification breaks the chain and is detectable.
  • Usage Tracking: Per-key daily and total request counts for monitoring and accountability.
Patent Protected: The Symbol Word Protocol classification algorithm runs entirely server-side. API consumers receive encoded output only — the tagging logic is never exposed. SWP is patent pending with the USPTO.

Health & Discovery

Public endpoints for monitoring system health and discovering available API endpoints. No authentication required.

GET /api/health

Returns real-time system health with per-component status. Use this for uptime monitoring, load balancer health checks, or integration readiness verification. Returns HTTP 200 when healthy or degraded, HTTP 503 when unhealthy.

Authentication: None — Rate Limit: 30 requests/minute

Example Request

curl https://ideaphase.app/api/health

Example Response (200 OK)

{ "status": "healthy", "components": { "api_server": { "status": "up", "response_time_ms": 1 }, "database": { "status": "up", "response_time_ms": 12 }, "proof_chain": { "status": "up", "response_time_ms": 8 }, "encoding_engine": { "status": "up", "response_time_ms": 3 } }, "timestamp": "2025-01-15T12:00:00.000Z", "version": "1.0" }

Status Values

Overall StatusHTTP CodeMeaning
healthy200All components are up
degraded200Some components have issues but service is available
unhealthy503One or more critical components are down

GET /api/v1/discovery

Returns a complete, machine-readable catalog of all available API endpoints grouped by category. Useful for automated API client generation, documentation tools, or integration bootstrapping.

Authentication: None — Rate Limit: 10 requests/minute

Example Request

curl https://ideaphase.app/api/v1/discovery

Example Response (200 OK)

{ "version": "1.0", "documentation": "https://ideaphase.app/swp-docs", "endpoints": { "encoding": { "v1": [ { "method": "POST", "path": "/api/v1/encode", "auth": "Bearer token", "description": "Encode text with SWP tags" }, { "method": "POST", "path": "/api/v1/encode/batch", "auth": "Bearer token", "description": "Batch encode up to 20 texts" } ], "v2": [ /* ... enhanced endpoints ... */ ] }, "proofs": [ /* ... proof endpoints ... */ ], "webhooks": [ /* ... webhook endpoints ... */ ], "api_keys": [ /* ... key management endpoints ... */ ], "health": [ { "method": "GET", "path": "/api/health", "auth": "none", "description": "System health check with component status" }, { "method": "GET", "path": "/api/status", "auth": "none", "description": "System status overview" } ] }, "rate_limits": { "encoding": "10 per minute (per API key)", "proofs": "30 per minute", "health": "30 per minute", "discovery": "10 per minute" } }
Integration Tip: Use the discovery endpoint to automatically configure your API client. The response includes all available endpoints, their authentication requirements, and current rate limits. This is the recommended starting point for new integrations.

GET /docs (Redirect)

Convenience redirect (HTTP 301) to /swp-docs. Provides a standard documentation shortcut for developers who expect to find API docs at /docs.

Authentication: None — Response: 301 Moved Permanently with Location: /swp-docs

# Both URLs reach this documentation curl -L https://ideaphase.app/docs curl https://ideaphase.app/swp-docs

Need Help?

IdeaPhase provides multiple support channels:

  • AI Support Chat: Get instant answers about SWP protocol, API usage, and troubleshooting at /support. Powered by GPT-4o with deep knowledge of the SWP platform. Available to all visitors, no login required.
  • System Status: Check real-time platform health at /status or programmatically via GET /api/health.
  • Email: ideaphase.needs@gmail.com for account-specific issues or partnership inquiries.

Integration Examples

Python

# pip install requests import requests API_KEY = "swp_your_api_key_here" BASE_URL = "https://ideaphase.app" # Encode a document response = requests.post( f"{BASE_URL}/api/v1/encode", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "text": "Your document content here...", "framework": "general" } ) result = response.json() tagged_text = result["tagged_document"]["full_text"] proof_id = result["proof"]["document_id"] proof_hash = result["proof"]["proof_hash"] print(f"Tagged document: {tagged_text[:200]}...") print(f"Document ID: {proof_id}") print(f"Proof hash: {proof_hash}") print(f"Chain position: {result['proof']['chain_position']}") # Verify the proof (no auth needed) verify = requests.get(f"{BASE_URL}/api/v1/proof/verify/{proof_hash}") print(f"Verified: {verify.json()['verified']}")

JavaScript (Node.js)

// Using fetch (Node 18+) or install node-fetch const API_KEY = "swp_your_api_key_here"; const BASE_URL = "https://ideaphase.app"; async function encodeDocument(text, framework = "general") { const response = await fetch(`${BASE_URL}/api/v1/encode`, { method: "POST", headers: { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ text, framework }) }); if (!response.ok) { const error = await response.json(); throw new Error(error.error); } return response.json(); } // Usage const result = await encodeDocument( "Contract clause: Party A shall deliver within 30 business days...", "legal" ); console.log("Phase:", result.tagged_document.core_tags.phase); console.log("Weight:", result.tagged_document.core_tags.weight); console.log("Proof:", result.proof.document_id); console.log("Chain #:", result.proof.chain_position);

cURL — Full Workflow

# Step 1: Encode a document RESPONSE=$(curl -s -X POST https://ideaphase.app/api/v1/encode \ -H "Authorization: Bearer swp_abc123..." \ -H "Content-Type: application/json" \ -d '{"text": "Deploy autonomous navigation module v2.3 with LIDAR failover.", "framework": "robotics"}') # Step 2: Extract the proof hash PROOF_HASH=$(echo $RESPONSE | jq -r '.proof.proof_hash') DOC_ID=$(echo $RESPONSE | jq -r '.proof.document_id') # Step 3: Download the full proof receipt curl -H "Authorization: Bearer swp_abc123..." \ https://ideaphase.app/api/v1/proof/$DOC_ID # Step 4: Publicly verify the proof (no auth needed) curl https://ideaphase.app/api/v1/proof/verify/$PROOF_HASH # Step 5: Verify your entire proof chain curl https://ideaphase.app/api/v1/proof/chain/swp_a1b2/verify

Integration Guide: SWP + Your Local LLM

This guide walks you through the complete workflow of using the SWP Encoding API with local language models like Ollama, LM Studio, or other Agent frameworks.

Key Concept: Your LLM never needs the API key. You call IdeaPhase, get back structured SWP-tagged output with a ready-to-use prompt template, then feed that template to your local model. The SWP tags guide the model to produce more structured, deterministic output.
Start Here: Call GET /api/v1/discovery to get a complete catalog of all available endpoints, their authentication requirements, and rate limits. This is the recommended first step when building a new integration. Need help? Visit the AI Support Chat for instant answers.

How the Flow Works

Your Text IdeaPhase API SWP-Tagged Prompt Your Local LLM

Your API key authenticates YOU to IdeaPhase — your LLM never sees it

  1. Send your raw text to the IdeaPhase /api/v1/encode endpoint with your API key
  2. Receive back: SWP-tagged document + prompt template + LoRA fine-tuning guidance + cryptographic proof
  3. Take the prompt_template from the response and send it to your local LLM
  4. The LLM reads the SWP tags and produces structured, compliance-aware output

Quick Start with Official SDKs (Recommended)

The fastest way to integrate SWP into your application is with the official SDKs. They handle authentication, error handling, and response parsing for you.

Python: Full Encode → Verify Workflow

from ideaphase import IdeaPhase client = IdeaPhase(api_key="swp_your_key_here") # 1. Encode your text result = client.encode( "Design a patient intake system for emergency departments.", framework="healthcare" ) # 2. Get the prompt template for your LLM prompt = result["prompt_template"] # 3. Send prompt to your local LLM (e.g., Ollama) import requests llm_response = requests.post("http://localhost:11434/api/generate", json={ "model": "llama3", "prompt": prompt, "stream": False }) print(llm_response.json()["response"]) # 4. Verify the proof later verification = client.verify_proof(result["proof"]["proof_hash"]) print(f"Proof valid: {verification['verified']}")

JavaScript/TypeScript: Full Encode → Verify Workflow

import { IdeaPhase } from "ideaphase"; const client = new IdeaPhase({ apiKey: "swp_your_key_here" }); // 1. Encode your text const result = await client.encode( "Design a patient intake system for emergency departments.", { framework: "healthcare" } ); // 2. Get the prompt template for your LLM const prompt = result.prompt_template; // 3. Send prompt to your local LLM const llmResponse = await fetch("http://localhost:11434/api/generate", { method: "POST", body: JSON.stringify({ model: "llama3", prompt, stream: false }) }); const llmResult = await llmResponse.json(); console.log(llmResult.response); // 4. Verify the proof later const verification = await client.verifyProof(result.proof.proof_hash); console.log(`Proof valid: ${verification.verified}`);
SDK vs Raw HTTP: The SDK examples above replace ~15 lines of raw HTTP setup (headers, error parsing, URL construction) with 2–3 lines. See the SDKs tab for full SDK documentation including batch encoding, webhooks, and proof sharing. The raw HTTP examples below are provided for users who prefer direct API access.

Integration with Raw HTTP (cURL, requests, fetch)

If you prefer direct HTTP calls without an SDK, follow the steps below.

Step 0: Test Your API Key

Before encoding, verify your key works with this simple test endpoint. It tells you exactly what the server received, helping you catch quoting issues.

Linux / Mac / Git Bash

curl https://ideaphase.app/api/v1/key/test -H "Authorization: Bearer YOUR_SWP_API_KEY"

Windows CMD (one line)

curl https://ideaphase.app/api/v1/key/test -H "Authorization: Bearer YOUR_SWP_API_KEY"

Windows PowerShell

curl.exe https://ideaphase.app/api/v1/key/test -H "Authorization: Bearer YOUR_SWP_API_KEY"
Expected response: {"valid": true, "key_prefix": "swp_XXXXXXXX", "is_founder": true, "message": "API key is valid and active"}
If you get "valid": false, the response will tell you exactly what went wrong (wrong format, extra characters, key not found, etc.).

Step 1: Encode with cURL

Choose your platform below. The commands do the same thing — the only difference is how each terminal handles quotes.

Important: All commands must be pasted as a single line. Replace YOUR_SWP_API_KEY with your actual API key (starts with swp_). If your terminal wraps the text visually, that's fine — just make sure you don't insert any line breaks when pasting.

Linux / Mac / Git Bash

curl -X POST https://ideaphase.app/api/v1/encode -H "Authorization: Bearer YOUR_SWP_API_KEY" -H "Content-Type: application/json" -d '{"text": "Design a patient intake system for emergency departments.", "framework": "healthcare"}'

Windows CMD

Inner quotes in the JSON body are escaped with \".

curl -X POST https://ideaphase.app/api/v1/encode -H "Authorization: Bearer YOUR_SWP_API_KEY" -H "Content-Type: application/json" -d "{\"text\": \"Design a patient intake system for emergency departments.\", \"framework\": \"healthcare\"}"

Windows PowerShell

Use curl.exe with the --% stop-parsing token. This tells PowerShell to pass everything after it directly to curl without any interpretation:

curl.exe --% -X POST https://ideaphase.app/api/v1/encode -H "Authorization: Bearer YOUR_SWP_API_KEY" -H "Content-Type: application/json" -d "{\"text\": \"Design a patient intake system for emergency departments.\", \"framework\": \"healthcare\"}"
PowerShell notes:
  • Use curl.exe (not curl) because PowerShell aliases curl to Invoke-WebRequest.
  • The --% (stop-parsing token) is the key — it prevents PowerShell from mangling your JSON. Everything after --% is passed exactly as typed.
  • With --%, use the same \" escaping as CMD.

All three commands return a JSON response. The prompt_template field contains the complete prompt ready for your LLM.

Send to Ollama (all platforms)

Linux / Mac / Git Bash:

curl http://localhost:11434/api/generate -d '{"model": "llama3", "prompt": "[PASTE THE prompt_template VALUE HERE]", "stream": false}'

Windows CMD:

curl http://localhost:11434/api/generate -d "{\"model\": \"llama3\", \"prompt\": \"[PASTE THE prompt_template VALUE HERE]\", \"stream\": false}"

Windows PowerShell:

curl.exe --% http://localhost:11434/api/generate -d "{\"model\": \"llama3\", \"prompt\": \"[PASTE THE prompt_template VALUE HERE]\", \"stream\": false}"

Python Integration

A complete Python script showing the full workflow:

import requests IDEAPHASE_URL = "https://YOUR-IDEAPHASE-URL" SWP_API_KEY = "swp_your_api_key_here" # Step 1: Encode with SWP swp_response = requests.post( f"{IDEAPHASE_URL}/api/v1/encode", headers={ "Authorization": f"Bearer {SWP_API_KEY}", "Content-Type": "application/json" }, json={ "text": "Your document or idea text goes here.", "framework": "general", "include_extended_tags": True } ) result = swp_response.json() prompt = result["prompt_template"] # Step 2a: Send to Ollama ollama_response = requests.post( "http://localhost:11434/api/generate", json={ "model": "llama3", "prompt": prompt, "stream": False } ) print(ollama_response.json()["response"]) # Step 2b: OR send to LM Studio (OpenAI-compatible) lm_response = requests.post( "http://localhost:1234/v1/chat/completions", json={ "model": "local-model", "messages": [ {"role": "system", "content": "Process this SWP-encoded document precisely."}, {"role": "user", "content": prompt} ], "temperature": 0.3 } ) print(lm_response.json()["choices"][0]["message"]["content"])
Download Full Integration Script

Complete Python script with Ollama, LM Studio, and OpenAI-compatible examples

Ollama Setup

Ollama runs open-source models locally on your machine. It has a simple REST API that works perfectly with SWP.

  1. Install Ollama from ollama.ai
  2. Pull a model: ollama pull llama3
  3. Start the server: ollama serve (runs on port 11434)
  4. Use the Python script above or the downloaded integration script
Recommended models for SWP: Llama 3 (8B or 70B), Mistral 7B, Phi-3, or Qwen 2.5. Larger models follow SWP tags more precisely, but even 7B models show significant improvement with tagged input.

LM Studio Setup

LM Studio provides a GUI for running local models with an OpenAI-compatible API server.

  1. Download from lmstudio.ai
  2. Search and download any GGUF model (Llama 3, Mistral, etc.)
  3. Go to the "Local Server" tab and click "Start Server" (runs on port 1234)
  4. LM Studio exposes an OpenAI-compatible API — use the /v1/chat/completions endpoint
import requests prompt = result["prompt_template"] # From SWP encode response response = requests.post( "http://localhost:1234/v1/chat/completions", json={ "model": "local-model", "messages": [ { "role": "system", "content": "You are processing an SWP-encoded document. Follow all tag instructions precisely." }, { "role": "user", "content": prompt } ], "temperature": 0.3, "max_tokens": 2000 } ) print(response.json()["choices"][0]["message"]["content"])

Agent Frameworks

For agent frameworks, the SWP API call happens from within your agent's tool or action definition. The key insight: SWP is a pre-processing step that runs before your agent sends text to its LLM.

Integration Pattern for Agent Frameworks

import requests def swp_encode_tool(text, framework="general"): """ Agent tool: Pre-process text through SWP before LLM reasoning. Add this as a custom tool in your agent framework. """ response = requests.post( "https://YOUR-IDEAPHASE-URL/api/v1/encode", headers={ "Authorization": "Bearer YOUR_SWP_API_KEY", "Content-Type": "application/json" }, json={"text": text, "framework": framework} ) data = response.json() return { "tagged_text": data["tagged_document"]["full_text"], "prompt": data["prompt_template"], "proof_id": data.get("proof", {}).get("document_id"), "tags": data["tagged_document"]["core_tags"] } # In your agent's workflow: # 1. Agent receives a task # 2. Agent calls swp_encode_tool() to tag relevant documents # 3. Agent uses the tagged prompt for its LLM reasoning # 4. Result: More structured, auditable agent output
Agent specific: Add the swp_encode_tool function as a custom tool in your Agent configuration. The agent can then call it to pre-process any document before reasoning. If your Agent runs in Docker, make sure the container can reach the IdeaPhase URL (use the public URL, not localhost).

Any OpenAI-Compatible Endpoint

SWP works with any system that accepts text prompts. If your tool uses the OpenAI API format (most do), use this pattern:

import requests def send_to_any_openai_endpoint(prompt, base_url, api_key="not-needed", model="default"): """Works with: LM Studio, Ollama (OpenAI mode), vLLM, text-generation-webui, LocalAI, and others.""" response = requests.post( f"{base_url}/v1/chat/completions", headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}" }, json={ "model": model, "messages": [ {"role": "system", "content": "Process this SWP-encoded document precisely."}, {"role": "user", "content": prompt} ], "temperature": 0.3 } ) return response.json()["choices"][0]["message"]["content"] # Examples: # Ollama (OpenAI mode): send_to_any_openai_endpoint(prompt, "http://localhost:11434") # LM Studio: send_to_any_openai_endpoint(prompt, "http://localhost:1234") # vLLM: send_to_any_openai_endpoint(prompt, "http://localhost:8000") # LocalAI: send_to_any_openai_endpoint(prompt, "http://localhost:8080")

What You Get Back from the API

Every encode call returns these key fields:

FieldWhat It ContainsWhat To Do With It
tagged_document.full_textYour text with SWP tags prependedUse for archival, display, or custom prompt building
prompt_templateComplete prompt with instructions + tagged documentSend this directly to your LLM — it is ready to use
tagged_document.core_tagsPhase, weight, symbolic_id, swp_sumUse for filtering, routing, or dashboard displays
tagged_document.domain_tagsSector, regulatory standards, compliance tagsUse for compliance checks and audit reporting
lora_guidanceFine-tuning parameters and tag dimension mappingsUse if building a custom LoRA adapter for SWP-native models
proofDocument ID, SHA-256 proof hash, chain positionStore for audit trail and tamper detection

Founder Key vs. Pro Key

FeatureFounder KeyPro Key
How to get itBecome a Co-Founder the key looks likeSWP_FOUNDER_API_KEYCreate from the API Key Management section on the main page (requires Pro subscription)
Daily limit500 requests/day100 requests/day
Rate limit30 requests/minute10 requests/minute
Max keysUnlimited5 per user
UsageInternal testing, development, demosClient/customer access
Security reminder: Never paste your API key directly into an LLM prompt or share it in chat. The key authenticates your API calls only — your LLM receives the prompt template (which contains the SWP tags and your document), not the key.

Verifying Proofs

Every encoded document gets a cryptographic proof. You can verify proofs publicly without authentication:

# Verify a specific proof (no API key needed) curl https://YOUR-IDEAPHASE-URL/api/v1/proof/verify/YOUR_PROOF_HASH # Check chain integrity for an API key curl https://YOUR-IDEAPHASE-URL/api/v1/proof/chain/YOUR_KEY_PREFIX/verify

This is how you prove a document existed at a specific time and hasn't been tampered with — critical for regulated industries.

Production Deployment Guide

This guide covers deploying SWP-tagged applications and integrating IdeaPhase into your production systems.

Frequently Asked Questions

Q: How do I deploy my SWP-tagged documents to production?

Tagged documents can be exported directly from IdeaPhase. Use the download buttons to get your tagged files (.txt format) or proof receipts (.txt format). These files can be integrated into any system that processes text.

Q: Can I verify document proofs after deployment?

Yes! Every proof includes a SHA256 hash and UTC timestamp. To verify: regenerate the hash from your document content using SHA256, then compare it to the stored proof. The hashes should match exactly if the document hasn't been modified.

Q: How do I integrate SWP tags with my AI system?

Add the recommended system prompt (available on the home page) to your LLM configuration. The prompt instructs AI to look for SWP meta-data headers first, then process content based on phase and weight indicators.

Q: What's the best way to batch process documents in production?

Pro subscribers can use the Batch Processing tab to tag multiple documents at once via the web UI. For programmatic access, use the SWP Encoding API — see the API Reference tab for full endpoint documentation with examples.

Q: How do domain frameworks affect my production workflow?

Domain frameworks (Healthcare, Robotics, Legal, Education, Finance) add compliance-specific tags. When your AI system sees @sector: Healthcare and @regulatory_standards: HIPAA, it knows to apply appropriate data handling rules. Choose the framework that matches your production domain.

Q: Are document proofs legally binding?

Cryptographic proofs provide strong evidence of document existence at a specific time. While not a substitute for legal registration, they serve as supporting evidence for IP claims, patent filings, and dispute resolution. Each proof includes a timestamp and can be independently verified.

API Integration

IdeaPhase provides a full REST API for programmatic SWP encoding, key management, and cryptographic proof verification. Pro subscribers can create API keys and start encoding immediately.

  • REST API: Full documentation with input/output examples in the API Reference tab
  • Proof Chain: Every API-encoded document gets a verifiable cryptographic proof with chain integrity
  • Code Examples: Python, JavaScript, and cURL examples ready to copy and use
  • 7 Domain Frameworks: Healthcare, Robotics, Legal, Education, Finance, AI-Agents, and General

For enterprise needs (custom rate limits, SLA guarantees, custom frameworks), contact ideaphase.needs@gmail.com.

Security Considerations

  • Data Privacy: Documents are processed but not stored permanently. Only proof hashes are retained.
  • HTTPS Only: All traffic is encrypted in transit.
  • No Third-Party Sharing: Your content is never shared with external parties.
  • Compliance Ready: Framework tags indicate but don't enforce compliance; implement appropriate controls in your systems.