<Note>Make sure you add Bearer prefix to your token</Note>
You can paste the command below into your terminal to run your first API request. Make sure to replace YOUR_RESPAN_API_KEY with your actual Respan API key.
model string: Specify which model to use. See the list of model
here
messages array required: List of messages to send to the endpoint in the OpenAI style, each of them following this format:
<strong>Image Processing</strong> If you want to use the image processing feature, you need to use the following format to upload the image
{ “role”: “user”, “content”: [ { “type”: “text”, “text”: “What’s in this image?” }, { “type”: “image_url”, “image_url”: { “url”: “https://as1.ftcdn.net/v2/jpg/01/34/53/74/1000_F_134537443_VendrqyXIWyHrZgxdIsfyKUost734JDP.jpg” } } ] }
tool_choice dict: Manually picking the choice of tool for the model to use. This will force the model to make a function call every time a function is passed in.
request_breakdown boolean: Adding this returns the summarization of the response in the response body. If streaming is on, the metrics will be streamed as the last chunk<strong>Regular Response</strong>
<strong>Streaming Response</strong>
models array: Specify the list of models for the router to choose between. If not specified,{” ”}
<strong>all models</strong> will be used. See the list of models
here
If only one model is specified, it will be treated as if model parameter is used and the router will not trigger.
fallback_models array: Specify the list of backup models (ranked by priority) to respond in case of a
failure in the primary model. See the list of models
here
customer_credentials object: You can pass in a dictionary of your customer’s credentials and deployment variables for supported providers and use their credits when the router is calling models from those providers.
customer_identifier string: Use this as a tag to identify the user associated with the API call.
metadata dict: You can add any key-value pair to this metadata field for your reference, contact team@respan.ai if you need extra parameter support for your use case.
Example:
disable_log boolean: When set to true, only the request and the performance
metrics will be recorded, input
and output messages will be omitted from the log.
exclude_models array: The list of models to exclude from the router’s selection. See the list of models here
This only excludes models in the router, if model parameter will take precedence over this parameter, andfallback_models and safety net will still use the excluded models to catch failures.
exclude_providers array: The list of providers to exclude from the router’s selection. All models under the provider will be excluded. See the list of providers here
This only excludes models in the router, if model parameter will take precedence over this parameter, andfallback_models and safety net will still use the excluded models to catch failures.
customer_api_keys object: You can pass in a dictionary of your customer’s API keys for specific models. If the router selects a model that is in the dictionary, it will attempt to use the customer’s API key for calling the model before using your integration API key or Respan’s default API key.API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys