One of the works in Sanskrit for “friend” is सखा (masculine). The root word is actually सखि the literal meaning of which is “one who is viewed equally by others” and is derived as shown here.
In the masculine, it is declined as सखा, सखायौ, सखायः , and the vocative singular form is (हे) सखे । In fact the grammatical declensions of this word are so different from those of other masculine words ending in इ (such as अग्नि or हरि) that Pāṇini had to create several rules just for this word. The word itself is very ancient and in use even today. The Ṛgveda contains at least a couple of hundred occurrences of various forms of this word, such as:
विष्णॊः॒ कर्मा॑णि पश्यत॒ यतो॑ व्र॒तानि॑ पस्प॒शे । इन्द्र॑स्य॒ युज्यः॒ सखा॑ ॥ (ऋ० १.२२.१९)
Behold (पश्यत) the deeds (कर्माणि) of Viṣṇu (विष्णोः), the friend (सखा) and companion (युज्यः) of Indra (इन्द्रस्य) – the deeds by which (यतः) he touches (पस्पशे) all undertakings (व्रतानि)!
तं त्वा॑ व॒यं वि॑श्ववा॒रा शा॑स्महे पुरुहूत । सखे॑ वसो जरि॒तृभ्यः॑ ॥ (ऋ० १.३०.१०)
(To Indra) O friend (सखे), beloved of all (विश्ववार), invoked by many (पुरुहूत) the treasure (वसो), we (वयं) pray (आ शास्महे) to you (तं त्वा) for (being graceful towards) the singers (जरितृभ्यः).
In the feminine, however, this word becomes सखी and Pāṇini gives it without derivation by the rule सख्यशिश्वीति भाषायाम् (४।१।६२) – the words सखी (female companion) and अशिश्वी (a woman without offspring) are given without derivation as used in common parlance (भाषायाम्).
Pāṇini uses the term भाषा to refer to the language that was spoken at his time, as opposed to the language of the Veda, which he generally indicates by the term छन्दस् । In this particular case, the word for female companion that was in use was सखी whereas in the Veda it was सखा । This is evidenced by the following statement from the Āśvalāyana Gṛhya Sūtra 1.7.19 (part of the description of the Vedic wedding ritual) – सखा सप्तपदी भव – “be my companion at the seventh step”, where the groom address the bride as सखा ।
The vocative for the word सखी (feminine) is सखि । Here is an example from the Gītagovinda of Jayadeva:
नृत्यति युवतिजनेन समं सखि विरहिजनस्य दुरन्ते – (Rādhā says) O friend (सखि), he (Hari) dances (नृत्यति) with the damsels (युवतिजनेन समं), to the distress of those separated from their lovers (विरहिजनस्य दुरन्ते)!