With a few code changes, you can use the OpenAI SDK to test the Task API. Parallel provides a compatibility layer that lets you quickly evaluate Parallel processors’ capabilities with minimal effort.

One important thing to note is that we only offer a single Speed processor, which is designed for interactive workflows where latency is paramount. For the best quality outputs, use the Task API.

Before You Begin

This compatibility is in beta and only offers the Speed processor. We provide a rate limit of 30 requests per minute for Speed out of the box. Contact us for production capacity.

For the best experience and access to Parallel’s best processors, we recommend using the Parallel Task API.

Getting Started with the OpenAI SDK

To use the OpenAI SDK compatibility feature, you’ll need to:

  1. Use an official OpenAI SDK
  2. Make these changes:
    • Update your base URL to point to Parallel’s beta API endpoint
    • Replace your API key with a Parallel API key
    • Update your model name to “speed”
  3. Review the documentation below for supported features

Performance and Rate Limits

Speed is optimized for interactive applications requiring low latency responses:

  • Performance: With stream=true, achieves 3 second p50 TTFT (median time to first token)
  • Default Rate Limit: 30 requests per minute
  • Use Cases: Chat interfaces, interactive tools

For production deployments requiring consistent performance at scale (reliable p99 latency) or higher throughput, contact our team.

Quick Start Examples

from openai import OpenAI

client = OpenAI(
    api_key="PARALLEL_API_KEY",  # Your Parallel API key
    base_url="https://beta.parallel.ai"  # Parallel's API beta endpoint
)

response = client.chat.completions.create(
    model="speed", # Parallel model name
    messages=[
        {"role": "user", "content": "What does Parallel Web Systems do?"}
    ],
    response_format={
        "type": "json_schema",
        "json_schema": {
            "name": "reasoning_schema",
            "schema": {
                "type": "object",
                "properties": {
                    "reasoning": {
                        "type": "string",
                        "description": "Think step by step to arrive at the answer",
                    },
                    "answer": {
                        "type": "string",
                        "description": "The direct answer to the question",
                    },
                    "citations": {
                        "type": "array",
                        "items": {"type": "string"},
                        "description": "Sources cited to support the answer",
                    },
                },
            },
        },
    },
)

print(response.choices[0].message.content)

Important OpenAI Compatibility Limitations

API Behavior

Here are the most substantial differences from using OpenAI:

  • Multimodal input (images/audio) is not supported and will be ignored.
  • Prompt caching is not supported.
  • Most unsupported fields are silently ignored rather than producing errors. These are all documented below.

Detailed OpenAI Compatible API Support

Request Fields

Simple Fields

FieldSupport Status
modelUse “speed”
response_formatFully supported
streamFully supported
max_tokensIgnored
max_completion_tokensIgnored
stream_optionsIgnored
top_pIgnored
parallel_tool_callsIgnored
stopIgnored
temperatureIgnored
nIgnored
logprobsIgnored
metadataIgnored
predictionIgnored
presence_penaltyIgnored
frequency_penaltyIgnored
seedIgnored
service_tierIgnored
audioIgnored
logit_biasIgnored
storeIgnored
userIgnored
modalitiesIgnored
top_logprobsIgnored
reasoning_effortIgnored

Tools / Functions Fields

Tools are ignored.

Messages Array Fields

FieldSupport Status
messages[].roleFully supported
messages[].contentFully supported
messages[].nameFully supported
messages[].tool_callsIgnored
messages[].tool_call_idIgnored
messages[].function_callIgnored
messages[].audioIgnored
messages[].modalitiesIgnored

Response Fields

FieldSupport Status
idAlways empty
choices[]Will always have a length of 1
choices[].finish_reasonAlways empty
choices[].indexFully supported
choices[].message.roleFully supported
choices[].message.contentFully supported
choices[].message.tool_callsAlways empty
objectAlways empty
createdFully supported
modelFully supported
finish_reasonAlways empty
contentFully supported
usage.completion_tokensAlways empty
usage.prompt_tokensAlways empty
usage.total_tokensAlways empty
usage.completion_tokens_detailsAlways empty
usage.prompt_tokens_detailsAlways empty
choices[].message.refusalAlways empty
choices[].message.audioAlways empty
logprobsAlways empty
service_tierAlways empty
system_fingerprintAlways empty

Error Message Compatibility

The compatibility layer maintains approximately the same error formats as the OpenAI API.

Header Compatibility

While the OpenAI SDK automatically manages headers, here is the complete list of headers supported by Parallel’s API for developers who need to work with them directly.

FieldSupport Status
authorizationFully supported
x-ratelimit-limit-requestsIgnored
x-ratelimit-limit-tokensIgnored
x-ratelimit-remaining-requestsIgnored
x-ratelimit-remaining-tokensIgnored
x-ratelimit-reset-requestsIgnored
x-ratelimit-reset-tokensIgnored
retry-afterIgnored
x-request-idIgnored
openai-versionIgnored
openai-processing-msIgnored