Flux Documentation

API Reference

OpenAPI endpoint documentation with request and response details.

Endpoints

Service health

GET
/health

Response Body

application/json

curl -X GET "https://flux-production-9c9e.up.railway.app/health"
{
  "status": "ok",
  "cohere_ready": true,
  "tavily_ready": true
}

Search web results

GET
/search

Query Parameters

q*string

Natural language query

Lengthlength <= 500
limit?integer
Default10
Range1 <= value <= 20
topic?string
Value in"news" | "general"
days?integer
Range1 <= value

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://flux-production-9c9e.up.railway.app/search?q=string"
{
  "query": "string",
  "results": [
    {
      "id": "string",
      "url": "http://example.com",
      "title": "string",
      "snippet": "string",
      "score": 0,
      "rank": 0
    }
  ],
  "total": 0,
  "reranked": true
}
{
  "error": "string",
  "code": "string"
}
{
  "error": "string",
  "code": "string"
}
{
  "error": "string",
  "code": "string"
}

Synthesize an answer

GET
/answer

Query Parameters

q*string
Lengthlength <= 500
topic?string
Value in"news" | "general"
days?integer
Range1 <= value

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://flux-production-9c9e.up.railway.app/answer?q=string"
{
  "query": "string",
  "answer": "string",
  "citations": [
    {
      "title": "string",
      "url": "http://example.com",
      "score": 0,
      "rank": 0
    }
  ],
  "model": "string"
}
{
  "error": "string",
  "code": "string"
}
{
  "error": "string",
  "code": "string"
}
{
  "error": "string",
  "code": "string"
}

Extract page contents

GET
/contents

Query Parameters

urls*string

Comma-separated URLs (max 10)

Response Body

application/json

application/json

application/json

curl -X GET "https://flux-production-9c9e.up.railway.app/contents?urls=string"
[
  {
    "url": "http://example.com",
    "title": "string",
    "content": "string",
    "word_count": 0,
    "success": true
  }
]
{
  "error": "string",
  "code": "string"
}
{
  "error": "string",
  "code": "string"
}

List conversations

GET
/conversations

Query Parameters

page?integer
Default1
Range1 <= value
page_size?integer
Default20
Range1 <= value <= 100

Response Body

application/json

application/json

curl -X GET "https://flux-production-9c9e.up.railway.app/conversations"
{
  "conversations": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "created_at": "2019-08-24T14:15:22Z",
      "message_count": 0
    }
  ],
  "total": 0,
  "page": 0,
  "page_size": 0
}
{
  "error": "string",
  "code": "string"
}

Create conversation

POST
/conversations

Response Body

application/json

curl -X POST "https://flux-production-9c9e.up.railway.app/conversations"
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "created_at": "2019-08-24T14:15:22Z",
  "message_count": 0,
  "messages": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "query": "string",
      "answer": "string",
      "citations": [
        {
          "title": "string",
          "url": "http://example.com",
          "score": 0,
          "rank": 0
        }
      ],
      "results": [
        {
          "id": "string",
          "url": "http://example.com",
          "title": "string",
          "snippet": "string",
          "score": 0,
          "rank": 0
        }
      ],
      "created_at": "2019-08-24T14:15:22Z"
    }
  ]
}

Get conversation

GET
/conversations/{conversation_id}

Path Parameters

conversation_id*string
Formatuuid

Response Body

application/json

application/json

curl -X GET "https://flux-production-9c9e.up.railway.app/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "created_at": "2019-08-24T14:15:22Z",
  "message_count": 0,
  "messages": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "query": "string",
      "answer": "string",
      "citations": [
        {
          "title": "string",
          "url": "http://example.com",
          "score": 0,
          "rank": 0
        }
      ],
      "results": [
        {
          "id": "string",
          "url": "http://example.com",
          "title": "string",
          "snippet": "string",
          "score": 0,
          "rank": 0
        }
      ],
      "created_at": "2019-08-24T14:15:22Z"
    }
  ]
}
{
  "error": "string",
  "code": "string"
}

Delete conversation

DELETE
/conversations/{conversation_id}

Path Parameters

conversation_id*string
Formatuuid

Response Body

application/json

curl -X DELETE "https://flux-production-9c9e.up.railway.app/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "error": "string",
  "code": "string"
}

Add conversation message

POST
/conversations/{conversation_id}/messages

Path Parameters

conversation_id*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

query*string
Lengthlength <= 500

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://flux-production-9c9e.up.railway.app/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08/messages" \  -H "Content-Type: application/json" \  -d '{    "query": "string"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "query": "string",
  "answer": "string",
  "citations": [
    {
      "title": "string",
      "url": "http://example.com",
      "score": 0,
      "rank": 0
    }
  ],
  "results": [
    {
      "id": "string",
      "url": "http://example.com",
      "title": "string",
      "snippet": "string",
      "score": 0,
      "rank": 0
    }
  ],
  "created_at": "2019-08-24T14:15:22Z"
}
{
  "error": "string",
  "code": "string"
}
{
  "error": "string",
  "code": "string"
}
{
  "error": "string",
  "code": "string"
}

On this page