Skip to content

API Documentation

To access the API Documentation, navigate to your workspace and click on API Documentation in the left sidebar. This will take you to the API documentation page where you can explore all available endpoints and model types.

The API Documentation page provides a centralized location for developers to understand how to interact with the FloTorch Gateway API, including request formats, response examples, and model specifications.

The FloTorch gateway supports two types of model specifications that you can use in your API requests:

  • Format: flotorch/<model_name>
  • Example: flotorch/smart-model
  • Description: FloTorch-managed models with intelligent routing and optimization
  • Use Case: Use this format when you want to leverage FloTorch’s intelligent model routing and optimization features
  • Format: <provider_name>/<model_name>
  • Example: open-ai-provider/gpt-4
  • Description: Access specific provider models (still routed through FloTorch gateway)
  • Use Case: Use this format when you need to access a specific model from a particular provider

The API Documentation is organized into different sections, each containing relevant endpoints for specific functionality:

Contains endpoints for model-related operations:

  • POST /openai/v1/chat/completions - Chat completions
  • POST /openai/v1/embeddings - Generate embeddings
  • POST /openai/v1/vector_stores/{id}/search - Vector store search

Contains endpoints for agent management:

  • GET /v1/agents/{name} - Get agent details

Contains endpoints for memory operations:

  • POST /v1/memory/{provider}/memories/list - List memories
  • POST /v1/memory/{provider}/memories - Create memory
  • GET /v1/memory/{provider}/memories/{id} - Get specific memory
  • PUT /v1/memory/{provider}/memories/{id} - Update memory
  • DELETE /v1/memory/{provider}/memories/{id} - Delete memory
  • POST /v1/memory/{provider}/memories/search - Search memories

Contains endpoints for RAG operations:

  • POST /v1/rag/{endpoint}/generate - Generate with RAG

Contains endpoints for Model Context Protocol operations:

  • POST /v1/mcps/{name}/proxy - Execute Model Context Protocol operations (tools, resources, etc.)

Contains endpoints for session management:

  • GET /v1/sessions - List sessions
  • POST /v1/sessions - Create session
  • GET /v1/sessions/{uid} - Get session details
  • DELETE /v1/sessions/{uid} - Delete session
  • GET /v1/sessions/{uid}/events - Get session events
  • POST /v1/sessions/{uid}/events - Add session event

Contains endpoints for workflow operations:

  • GET /v1/workflows/{name} - Fetch workflow configuration
  • POST /v1/workflows/{name}/run - Submit workflow
  • GET /v1/workflows/{name}/invocations/{invocationId} - Get workflow invocation details
  1. Use the section tabs at the top of the API endpoints area to switch between different endpoint categories
  2. Each section is clearly labeled with an icon and name for easy identification
  3. The active section is highlighted with a primary color background

Each endpoint card displays:

  • HTTP Method - Color-coded badge (GET, POST, PUT, DELETE)
  • Endpoint Path - Full URL path with copy button
  • Description - Brief explanation of what the endpoint does
  • Request Body Example - Expandable JSON example (when applicable)
  • Response Example - Expandable JSON response example (when applicable)
  1. Click the copy button next to any endpoint URL to copy the full path
  2. Expand request body examples to view formatted JSON
  3. Click the copy button in the code block to copy the entire JSON example
  4. Use these examples directly in your API requests
  • Click on “View Example Request Body” to expand and see formatted JSON
  • Examples are syntax-highlighted for better readability
  • All examples include realistic data that you can modify for your use case
  • Click on “View Example Response” to see what the API returns
  • Response examples show the expected structure and data types
  • Use these to understand how to parse API responses in your application

The API Documentation automatically displays your workspace’s gateway URL as the base URL for all endpoints. This URL is:

  • Automatically loaded when you access the documentation page
  • Used as the prefix for all endpoint examples
  • Required for making actual API requests to the FloTorch Gateway

If the gateway URL cannot be loaded, you’ll see an error message with instructions to check your connection.

The API Documentation page includes a “Quickstart docs” button that links to external comprehensive documentation. This provides:

  • Detailed setup instructions
  • Authentication requirements
  • Advanced usage examples
  • Best practices and troubleshooting
  • Use flotorch/<model_name> format for optimal performance and intelligent routing
  • Use <provider>/<model_name> format when you need specific provider models
  • Always ensure the model name matches exactly what’s available in your workspace
  • Include proper authentication headers in your requests
  • Use the exact endpoint paths shown in the documentation
  • Follow the request body format exactly as shown in examples
  • Handle responses according to the provided response examples
  • Check the HTTP status codes in responses
  • Review error messages for troubleshooting
  • Ensure your request format matches the documentation examples

The API Documentation feature provides everything you need to successfully integrate with the FloTorch Gateway API, from understanding model types to implementing complete workflows.