Skip to content

Usage instructions

Vinícius B. Matos edited this page Mar 13, 2025 · 1 revision

Using HarpIA Model Gateway

After setting up HarpIA Model Gateway (see instructions), its server will provide the following API endpoints:


1. List Providers

GET /list

Retrieve a list of available answer providers and their capabilities.

Response example:

{
  "providers": [
    {
      "name": "your_first_model",
      "supports_system_prompt": true,
      "default_system_prompt": "You are a helpful assistant. Answer concisely."
    },
    {
      "name": "your_second_model",
      "supports_system_prompt": false,
      "default_system_prompt": ""
    },
  ]
}

Fields:

  • name: model name;
  • supports_system_prompt: whether system prompts are supported by the answer provider;
  • default_system_prompt: the default system prompt, if available.

2. Send Message

POST /send

Send a message to an answer provider and receive a response.

Request example:

{
  "query": "What is 2 + 2?",
  "answer_provider": "your_model_name",
  "history": [],
  "system_prompt": ""
}

Fields:

  • query: the user query (last message), as a string;
  • answer_provider: the provider's name as defined in the configuration file;
  • history: the ordered list of messages (as strings) before the current query, containing an even number of messages (the first message is from the user, the second message is from the model, and so on);
  • system_prompt: the system prompt to the model (not supported by some models), overriding the default prompt.

Response example:

{
  "contexts": [],
  "interaction_id": "20250201_194510_856901_8ef1a5908ba84562bd77258e76bcafe2",
  "text": "2+2 equals 4."
}

Fields:

  • contexts: currently unused;
  • interaction_id: unique id of the interaction;
  • text: the generated answer.

Clone this wiki locally